Laravel Pro Tips
#eloquent #models
Laravel / Eloquent tip ๐ To select specific columns on a model you can use the select method -- or you can pass an array directly to the get method!
Daniel Eckermann
#cheatsheet #mail
๐#Laravel Mail #cheatsheet ๐ฅ #PHP
Aaron Lumsden ๐ | Indie Hacker Dev
#validation #passwords
Laravel password validation rules are๐ฅ There's even an 'uncompromised' that checks the password in the 'have i been pwned' database:
Martin Joo
#routes #controllers
#Laravel Tip โก Instead of using the controller in each route, consider using a route controller group.
Sanjit Singh
#relationships #foreign key
#Laravel #Database Tip: While creating migrations you may also specify the desired action for the "on delete" and "on update" properties of the constraint. Here are more methods that #Laravel provides ๐ #Laravel #Database #PHP https://t.co/pr3arpPGdk
Laravel Eloquent
#eloquent #models #cheatsheet
๐ฅ Laravel Tip: A cheatsheet of some things you can overwrite in your Eloquent models to fit your application better.
Cosme Escobedo
#validation
Checkboxes are a pain to validate against because if theyโre not checked theyโre not present in the HTTP request. You can solve this by using a hidden input, but #Laravel makes it easy to set up a default in the Request. Now `$request->opt_in` is always true or false. #PHP #Code
trovster
#requests
๐#laravel Request URL Cheat Sheet. ๐ฅ
#migrations #seeders
๐ฅ #Laravel Tip: Sometimes you need to seed a database with millions of records e.g. for stress-testing. To avoid crippling the DB with millions of โcreateโ queries, instead consider โmakingโ a large collection of models, then chunk and insert them.
Matt Kingshott