How to Use Eloquent in Slim Framework

The Eloquent ORM makes it incredibly easy to interact with a database. Today we’ll look at how we can use Eloquent to interact with our database inside your Slim Framework. The Eloquent ORM provides an ActiveRecord […]

Laravel 5.5 – How to log all Eloquent Queries

In this post, I will show you simple method to log each and every Eloquent Query of your application executes. We gonna log queries to the storage/logs/laravel.log file. To log database queries we gonna add a database […]

Polymorphic Eloquent Relationships in Laravel 5

In this post, I would like to show you creating polymorphic relationships in the Laravel5 application. Probable polymorphic relationships are the most advanced eloquent relationships in all available joins in Laravel. […]

Laravel eloquent complex queries on relationships

Very Laravel developer should know this little trick, using this trick you can define complex conditions on the eloquent relationships. This method chaining helps you to add custom where/filter conditions for relation […]

Laravel 5 Eloquent – Attribute casting

One of the Laravel 5 awesome feature is Attribute casting. Casting attribute means changing the attribute values to a particular type. for example Boolean, integer, strings. Eloquent models allows you to change datatype […]

Laravel 5 Eloquent lazy eager loading

Sometimes you may need to eager load a relationship after the parent modal has already been retrieved. For Example this may be very useful if you need to dynamically decide whether to load related models or not, or in […] Protection Status