{ Laravel snippets }

Jason Beggs

Jason Beggs @jasonlbeggs

๐Ÿ”ฅ Reminder: When testing with Laravel, you can use the from() method to automatically set a referer url. This allows you to test redirects that use the redirect()->back() helper. https://t.co/1ny0hrAY2c

Stefan Bauer

Stefan Bauer @stefanbauerme

๐ŸŒŸ I'm working on a little feature at the moment and I thought it might be worth sharing. Another tip when you need to work with time intervals and seconds. Using `CarbonInterval` makes it much more readable. https://t.co/ktpNR7BoKY

Taylor Otwell ๐Ÿ

Taylor Otwell ๐Ÿ @taylorotwell

This is something I don't think we document well enough. If you prefer a "Models" directory... you can do things like php artisan make:policy PhotoPolicy --model=Models/Photo.... php artisan make:model Models/Photo... etc. All works fine! ๐Ÿฅฐ https://t.co/ZykVwAbpgH

Paul Redmond ๐Ÿ‡บ๐Ÿ‡ธ

Paul Redmond ๐Ÿ‡บ๐Ÿ‡ธ @paulredmond

๐Ÿ”ฅ If you want to make assertions on JSON returned from Laravel's API Resources, get the values wrapped in {'data': {}} by passing the 'data' key: https://t.co/y0CAIfYIW1

Rias Van der Veken

Rias Van der Veken @Riasvdv

๐Ÿ”ฅ Don't want Laravel Mix complaining about the manifest during your CI tests and don't want to compile them to save time? Add this to your base TestCase https://t.co/Yuip8vL6cq

Hey Future Jake ๐Ÿ‘‹ ๐Ÿค“ Need to create a large file full of random stuff on the command line? dd to the rescue! dd if=/dev/urandom of=file.txt bs=1048576 count=100 The last number is the approximate final file size in MB. https://t.co/810bh0hEZp

Gaurav Makhecha

Gaurav Makhecha @gauravmakhecha

๐Ÿง Most of our @laravelphp Passport implementations do not use actual OAuth stuff. They are limited to Password Grant Tokens. And by default Passport adds 15 routes. This is how to tweak it to add only 3 ๐Ÿ‘‡ https://t.co/5REY7XuJZT

Stefan Bauer

Stefan Bauer @stefanbauerme

๐Ÿคฉ Here is another thing I noticed lately. Did you know you @laravelphp introduced a new artisan command in v6? `php artisan db:wipe` to drop all tables, views, and types? You can pass the options `--drop-views` and `--drop-types` (Postgres only). This is awesome!

Laravel Daily

Laravel Daily @DailyLaravel

#Laravel tip of the day: if you want to create a middleware and run it on most of your pages, so on all of them except one or two - you can specify the exceptions in Middleware class itself, in $except array. https://t.co/PuhPcHFvVv

Jason McCreary

Jason McCreary @gonedark

โš—๏ธ Whenever I generate test data, I like to explicitly set values which could change behavior, even if they are currently defaulted with the same value. The future brings change and resolving such a failure can be hard. https://t.co/d030JfKbJO