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