Top "Eloquent" questions

The Eloquent ORM included with Laravel provides a beautiful, simple ActiveRecord implementation for working with your database.

Unexpected data found during save on eloquent / Laravel

I have one more field on the database over the created_at and updated_at as TIMESTAMP the field name …

php laravel-4 eloquent php-carbon
Laravel 5.5 API resources for collections (standalone data)

I was wondering if it is possible to define different data for item resource and collection resource. For collection I …

php laravel eloquent laravel-5.5 thephpleague-fractal
How to sort NULL values last using Eloquent in Laravel

I've got a many to many relationship between my employees and groups table. I've created the pivot table, and all …

php many-to-many laravel eloquent
Difference between Eloquent\Model::get() and all()

What is the difference between uses User::all() and User::get() on Eloquent? On Laravel API it describes only all() …

php laravel laravel-5 eloquent
Group_concat - laravel eloquent

please I want to use group_concat in a query using eloquent and not raw queries. here is the code …

laravel eloquent group-concat
Laravel Eloquent ORM replicate

I have a problem with replicating one of my models with all the relationships. The database structure is as follows: …

php laravel eloquent clone relationship
Get all users with role in Laravel

I'm working in this Laravel project which has this structure users: id | first_name |... roles: id | name assigned_roles: id | …

php laravel laravel-4 eloquent roles
Laravel 5.2 multiple model save()

I need to store exactly three pages at once via form. I would like save in similar manner as model …

eloquent laravel-5.2 mass-assignment
laravel migration re-organising column order

When you create a new column in a table you can use the ->after('column name') to dictate …

laravel-4 eloquent fluent
Search object by slug and not by id

I'm a relative beginner with Laravel (using version 5.2.3) and have been working through tutorials on Laracasts and then doing a …

laravel laravel-5 eloquent laravel-routing laravel-5.2