Laravel Community Tools by
Tighten
Laravel Versions
PHP Releases
Nova Packages
Laravel Tricks
Forge Recipes
Toggle navigation
Log in
Log in
Fatih Toprak
Joined:
5 years ago
Total tricks:
3
Last trick:
5 years ago
Submitted tricks
Eloquent
Don't filter null records.
You can filter by NULL in Eloquent, but if you're filtering the collection further - filter by empty string, there's no "null" in that field anymore.
fatihtopra...
5 years ago
15220
eloquent
Eloquent
Change Default Timestamp Fields
What if you’re working with non-Laravel database and your timestamp columns are named differently? Maybe, you have create_time and update_time. Luckily, you can specify them in the model, too
fatihtopra...
5 years ago
14995
eloquent
Eloquent
Never Update the Column
If you have DB column which you want to be set only once and never updated again, you can set that restriction on Eloquent Model, with a mutator
fatihtopra...
5 years ago
17622
eloquent