Laravel Tips & Tricks
Specified Key Too Long Fix
Fix the annoying migration error "Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes "
1
0
0
8 Aug, 07:20 AM
Splitting Routes in Lavavel 8
If you have a complex site web.php can soon become an untameable beast.
4
0
0
11 Jul, 07:19 PM
Model boot() method
There is a magical place called boot() in an Eloquent model where you can override default behavior
0
0
0
21 Sep, 06:50 AM
XorY methods
Eloquent has quite a few functions that combine two methods, like “please do X, otherwise do Y”.
0
0
0
21 Sep, 06:46 AM
Virtual Fields in a Model
Something I am often asked is can you have a virtual field in a model. Well yes you can. Laravel has a feature "Accessors" which is really useful.
0
0
0
20 Sep, 01:58 PM
A Whole Host of Helpers Easily
When I first came to Laravel I came across a really easy trick to use helpers.
2
0
0
25 Jun, 01:14 PM
Breaking up the web.php file
This is a file that can easily become very large and difficult to manage
1
1
1
25 Jun, 10:26 AM