Laravel Pro Tips
#cheatsheet #config
π A #laravel Config #CheatSheet π The great thing about Laravel is the documentation is in the method names. π€
Aaron Lumsden π | Indie Hacker Dev
#models #factories
π₯ Laravel Tip: Factory states You can create factory states in your model factories to hide the details about the model attributes and make your tests more readable.
Cosme Escobedo
#migrations
While adding a New Column to existing table using Migration, the column is always added at the last.β You can use the after() to place the New Column after a specific column.β You can also use the first() to place the New Column at the start of the table. #Laravel #PHP
Aftab Khan π
#http #cheatsheet
π A #laravel HTTP Client #CheatSheet β‘οΈSome of the methods you can use before you send your request π₯
#storage #cheatsheet
π A #laravel Storage #cheatsheet π₯ #php How many of these methods do you know? π
#routes #models
#Laravel Tip π₯ When using a custom keyed implicit binding as a nested route parameter, Laravel will automatically scope the query to retrieve the nested model by its parent using conventions to guess the relationship name on the parent.
Sanjit Singh
#authorization #livewire
#Laravel livewire Tip: If you want to use `authorize` method inside livewire component, all what you need to do, is to use `AuthorizesRequests` trait. Here is how to do it:
Oussama Sid
#eloquent #models
#Laravel Eloquent Tip π₯ You can use 'save' and 'saveMany' methods for adding new models to the relationships.
Gurmandeep Singh
#eloquent #update
π₯ Laravel Tip: Did you know that mass updates return the number of affected rows? This is useful when you want to display the number of records that were updated in the database.