Laravel Pro Tips
#commands #artisan
πΆοΈ #Laravel Tip: Inside an πΌπ§π©ππ¨ππ£ πΎπ€π’π’ππ£π, you can execute bash scripts using the ππππ() function. Here's an example with an explanation π #PHP #Developers
Bilal Haidar - Available 4 Laravel gigs
#models #traits
πΆοΈ #Laravel Tip: ππ§πππ©π¨ allows us to share code among Classes & specifically ππ€πππ‘π¨. You can seamlessly integrate with the Model booting & initialization process using traits. β Statically via boot{Trait} β Dynamically via initialize{Trait}
#validation #csrf
#Laravel Tip π₯ You can exclude the CSRF verification by inserting the URL in $except array of VerifyCsrfToken Middleware.
Gurmandeep Singh
#eloquent #scopes
π₯ #Laravel Tip: Make use of local scopes in your Eloquent models in order to make your queries much easier to understand at a glance.
Matt Kingshott
#exceptions
π‘ A nice, undocumented feature of @laravelphp: you can βmapβ exceptions from one type to another in your exception handler. Nice for converting βdomainβ exceptions to a more appropriate HTTP exception #Laravel
Martin Bean
#redirects
#Laravel Quick Tip π₯ : Sometimes you want to redirect the user to previous page. There are couple of ways to do in Laravel. #PHP #100DaysOfCode #webdevelopers #developers
Mohammad Haris β‘
#performance #database #indexes
#Laravel #Eloquent Advice: If you are making queries by adding a where condition on a string based column, it is better to add an index to the column. Queries are much faster when querying rows with an index column. #Laravel #Database #PHP
Laravel Eloquent
#cache
πΆοΈ #Laravel tip: Laravel caching comes in handy especially when you are serving some static pages or static data. For instance, serving a list of countries, that rarely changes! #PHP #Developers
#eloquent #models #collections
π₯ Quick #Laravel Tip - If you have to return the primary keys for all models in the collection, instead of using `pluck()->toArray()` you can use `modelKeys()`
Marian Pop πΊπ¦ Laravel Magazine