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
#Laravel tip of the day: did you know that in JSON Resource class you can specify with() or withResponse() methods to return some *meta* data with response? Like version number or some header value. Read more here: https://t.co/ruuFOqwdPI https://t.co/yFh1OOyoob
🧐 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
🤩 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 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
Needed to trim all items from the end of a collection that matched a certain condition so whipped up a quick macro 💅 https://t.co/Cq7RtUEHl3
⚗️ 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
#laraveltip The DB and Eloquent Query Builder classes contain a `pluck` method. So… https://t.co/bpjEs5PJf0
Did you know? You can extend your paginators's query string with the append() method. So useful! 🤝 #Laravel https://t.co/JQGlpzFbLh
🔥 If you want to append params to your GET routes (for example to simulate filtering in your tests), just pass as a second parameter to the route an array with values. #laravel #laravelphp #tdd #testing https://t.co/hrQSHxXYUh
Did you know that in Laravel you can optimize your WHERE clause?
This is so simple and Magic! https://t.co/5PLXHrhpaA
A way to extend the Nova heading component. #LaravelNova, #VueJS https://t.co/9OGaj7DqRO
🔥 TIP When using #laravel collections, you can further tidy up your code by extracting the callable into its own function. #php #collections https://t.co/a12H5tim3m
Today I learned that Laravel 5.5+ has a built-in today() helper that returns a Carbon instance for the start of the current day. https://t.co/TnLxQAe94N
#Laravel tip of the day: in your error pages, you can disable some "sensitive" variables from showing, use config/app.php file and "debug_blacklist" array. The most sensitive ones are blacklisted by default. Read more here: https://t.co/uo76qheR8W https://t.co/xDKf7EzR5o
TIP: Did you know that you can add extra fields to your Eloquent model it's json output by defining them in the '$appends' property on the model in combination with Eloquent accessors? 🔥
TIP: You want to export #laravel eloquent query to native mysql? Here's a quick way to do it: https://t.co/ORGfKtEHNY - Gives out everything you need to run it in mysql console
* Warning, doesn't go friendly with relationships and so on. Works on single queries
🔥 When using Laravel Dusk to test @stripe Elements integrations, sometimes Dusk will type faster than Elements can handle, so I use this little trick which adds a pause between each keystroke: https://t.co/GbG0crVMMS
#Laravel tip of the day: if you need to add a new column to the database table, in migration you should probably check if the table exists and if the column doesn't exist yet. Here's the snippet: https://t.co/iwEO2iWDaK