Laravel Community Tools by Tighten

Tag "models" tricks

58 tricks
When registering a model observer using `Model::observer(Observer::class)`, you can return false and laravel will cancel the method.
stevebauma... 10 years ago 21306
There is easy way to update relation model without query for related model.
monaye 10 years ago 13442
The easy way to define Eloquent Global Scopes with https://github.com/jarektkaczyk/laravel-global-scope
jarektkacz... 10 years ago 8188
Get results in a table when there are no results for the relationship
wallacemax... 10 years ago 20304
Using Sentry With Eloquent
Mahmoudz 11 years ago 8991
Model Based Setting Different Connection when working with 2 or more database in laravel
dhrubo001 11 years ago 6979
Switching Maintenance Mode to Production And Vice Versa Quickly in laravel 4.2
dhrubo001 11 years ago 8587
A variation of http://www.laravel-tricks.com/tricks/column-selection-in-eager-loading Credits: http://stackoverflow.com/questions/16994253/laravel-eager-loading-load-only-specific-columns Warning: this trick does not work on many-to-many relations, see: https://github.com/laravel/framework/issues/2966
orlissenbe... 11 years ago 19039