Laravel Pro Tips
#Laravel Tip💡Put this trait on all your models to track easily who created and updated a model.
🔥 Laravel Tip: use scopes to make your code more readable.
You can even combine multiple scopes. It's an awesome feature!.
Some ways to refactor if condition in Laravel.
The Laravel Dev
Laravel tip 🔥
Instead of writing multiple resource controllers, you can register many resource controllers at once by passing an array to the resources method.
#laravel #buildinpublic #coding
Hamza Ikram || Laravel Developer
🔥 Laravel Tip: Make sure to use Route::view() when it's possible.
Check out this example:
Laravel tip💡You can add a Temporary URL for the local storage driver
🔥 I have been using #Laravel for years and I just discovered the migrate:status command. It shows you which migrations have run so far.
🔥 Laravel Tip: Customizing The Resolution Logic
You can define how your model gets bound by overwriting the resolveRouteBinding in your model class.
For example, if you need to resolve a model with two separated fields.
🔥 #Laravel Tip: When communicating with third-party APIs via Laravel's HTTP client, consider adding a user agent that identifies your app. That way, if there's a problem, the API owner can identify you (via their HTTP logs) and contact you (instead of blocking you).