{ All snippets }

Tweetsnippet is a curated list of tips and tricks from Twitter.

Tim MacDonald

Tim MacDonald @timacdonald87

Step 2: Return your dedicated builder from the `newEloquentBuilder` method on your model. ? Scopes on your model will continue to function, so you can progressively refactor if you need. https://t.co/mEXv7MZz80

Tim MacDonald

Tim MacDonald @timacdonald87

? Want to thin out your @laravelphp models? You can relocate scopes to dedicated builder object. Gain: ✅ Thinner models ✅ Click through in your editor ✅ Static analysis (if that's ur bag) Lose: ❎ Having every co-located Step 1: Make a custom builder https://t.co/yr8UZs0gB7

Chris Fidao

Chris Fidao @fideloper

? A very useful trick is creating calculated attributes on your Model classes - you can treat them like any other column, e.g. Foo::find(1)->recently_updated; // boolean https://t.co/mrgwLqxxUg