So here are the 20 tips and trick on Laravel provide by Ashley Allen.
- Using DATETIME Fields Instead of Booleans
- Naming Date and Time Columns
- Using Matrix Sequences in Factories
- Using ‘when’ in PendingRequest
- Using ‘checked’ and ‘selected’ Blade Directives
- Using ‘Mockery::on()’ in PHPUnit tests
- Using getOrPut() in Collections
- Debugging HTTP Requests
- Replicating Models
- Adding Auto-complete Hints to Artisan Commands
- Using ‘wasRecentlyCreated’ on Models
- Changing the Key for Route Model Binding
- Using Dependency Injection
- Filtering Collections by Class Type
- Defining Custom Temporary URL Logic
- Validating MAC Addresses
- Encrypting Fields in the Database
- Moving Logic into Methods
- Using the Different Maintenance Mode Options
- Using Readonly Properties
Credits : https://bit.ly/3wdjlTF