Laravel doesn't have built-in support to fetch next and previous records, but adding a couple of helper methods to your model does the trick.
Ordering in Laravel is pretty straightforward, but you can use a few other techniques to make the most of Eloquent's ordering abilities. Let's cover everything you should know about ordering queries with Laravel!
If, for any reason, you need to get the fillable fields from a Laravel model, it's pretty straightforward.
It's pretty straightforward to use Eloquent outside of the Laravel Framework. Let's look at all the steps to get it working, whether you want to pull it into another framework or use it in procedural code.
Laravel doesn't support has many through pivot relationships out the box, but we can still achieve this manually with a pivot model.
If you move over some functionality to a trait in Laravel that requires casts to be added as part of the trait's functionality, this won't merge by default.
I recently needed to listen to events on a pivot table within the Codecourse codebase. When a user resets progress for a course, and all the episodes they've completed are detached, episode progress (stored in Redis) should be removed.
Extracting some functionality to a trait but need to use the static booted method within that trait? Here's how.
Table names don't change often, but it's still nice to reference table names directly from your Eloquent models, so you don't end up with a bunch of hardcoded table names.
If you're merging multiple models into a Laravel collection or just have a collection of data you need to paginate, here's an easy, clean way to do it.