Laravel Pro Tips
#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 π₯
Aaron Lumsden π | Indie Hacker Dev
#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 #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.
Cosme Escobedo
#eloquent #models
#Laravel Eloquent Tip π₯ You can use 'save' and 'saveMany' methods for adding new models to the relationships.
Gurmandeep Singh
#eloquent #scopes
π₯ Laravel Tip: use scopes to make your code more readable. You can even combine multiple scopes. It's an awesome feature!.
#models #auditing
#Laravel Tipπ‘Put this trait on all your models to track easily who created and updated a model.
Jamil Soufan