Top "Eloquent" questions

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

How to set every row to the same value with Laravel's Eloquent/Fluent?

I need to update all of the rows in a database so that a particular field in all of them …

laravel eloquent fluent laravel-3
Eloquent collections: each vs foreach

Might not be a question specific to Eloquent collections, but it just hit me while working with them. Let's just …

php laravel eloquent
Eloquent eager load Order by

I have problem with eloquent query. I am using eager loading (one to one Relationship) to get 'student' With the …

laravel laravel-4 eloquent eager-loading
Laravel 5.1 Create or Update on Duplicate

In Laravel 5.1, for MySQL insert, I want to see if the record already exists and update on duplicate or create …

laravel laravel-5 eloquent query-builder
How to set Laravel Carbon timezone for timestamps?

I have a project which is primarily based in CET region. I set CET in config/app.php, but all …

laravel eloquent php-carbon
Eloquent push() and save() difference

I have read laravel 4 docs about eloquent and was quite intrigued by the push() part. It says, Sometimes you may …

laravel laravel-4 eloquent
Laravel 5 : MassAssignmentException in Model.php

I am getting this error: MassAssignmentException in Model.php line 448: _token When I am using create method. Please review code …

php laravel laravel-5 eloquent mass-assignment
Retrieving relationships of relationships using Eloquent in Laravel

I have a database with the following tables and relationships: Advert 1-1 Car m-1 Model m-1 Brand If I want …

php laravel eloquent object-relationships
Update without touching timestamps (Laravel)

Is it possible to update a user without touching the timestamps? I don't want to disable the timestamps completly.. grtz

php laravel laravel-4 eloquent
Preventing Laravel adding multiple records to a pivot table

I have a many to many relationship set up and working, to add an item to the cart I use: $…

php laravel laravel-4 eloquent