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 21143
There is easy way to update relation model without query for related model.
monaye 10 years ago 13307
The easy way to define Eloquent Global Scopes with https://github.com/jarektkaczyk/laravel-global-scope
jarektkacz... 10 years ago 8109
Get results in a table when there are no results for the relationship
wallacemax... 10 years ago 20178
Using Sentry With Eloquent
Mahmoudz 10 years ago 8879
Model Based Setting Different Connection when working with 2 or more database in laravel
dhrubo001 10 years ago 6859
Switching Maintenance Mode to Production And Vice Versa Quickly in laravel 4.2
dhrubo001 11 years ago 8504
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 18900