Laravel Pro Tips
You can exclude middleware at the route level in Laravel using the withoutMiddleware method.
Copy files more efficiently from one place to another on S3 using the AWS SDK copyObject method instead of the built in S3 adapter, which downloads then copies. A tip from @therobfonz. #laravel #PHP
🔥 #Laravel Tip: Thanks to model accessors, adding a url-safe slug to a blog post model is exceptionally easy to do. Include it in the ‘appends’ array to make it available when calling toArray().
#Laravel Tip 🔥
You can use `whereColumn` method to compare the values of two columns.
🔥 Laravel Tip: If you have an eloquent collection, and you want to update every model.
You can use the `toQuery` method, and execute the update with only one query instead of looping through the collection.
🔥 #Laravel Tip: Hot off the press, the latest release includes the ‘squish’ global helper method by @DwightConrad. It removes all extraneous white space from a string, including between words. It’s like ‘trim’ on steroids :)
🔥 Laravel tip: Customizing Missing Model Behavior in route model bindings
By default, Laravel throws a 404 error when it can't bind the model, but you can change that behavior by passing a closure to the missing method.
A handy Laravel tip 🔥
If for some reason, your URL is having query parameters, you can retrieve the URL without query parameters using the `fullUrlWithoutQuery` method of request like so.
https://t.co/BVFTzaZs2H #Laravel #PHP
Laravel Tip 💡 Use Laravel's retry helper when dealing with an unstable API. For example, retry a request three times and wait one second between every retry.