Top "Eloquent" questions

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

Laravel Sync error

I am running the following code, if( $organisation->save() ) { if(isset($members)) { $organisation->users()->sync($members); } …

php laravel eloquent relationships
Filtering pivot table data with Laravel models

Let's say I have three tables (this is just an example): users user_id username roles role_id name user_…

php laravel filtering eloquent pivot-table
Adding new property to Eloquent Collection

Trying to add new property to existing collection and access that. What I need is something like: $text = Text::find(1); //…

laravel laravel-5 eloquent laravel-5.2 laravel-collection
Laravel - Where to store statuses (flags)? Model, Class or config folder?

I need to extensively use statuses in mt project. I need them for my users (active, suspended, etc), an entity (…

php mysql laravel eloquent status
Laravel belongsToMany where doesn't have one of

I have two tables: categories and videos, I then have a pivot table for these as it's a belongsToMany relationship. …

php mysql laravel eloquent has-and-belongs-to-many
Laravel 4, eloquent - between statement and operators

There is a query I use to run in mysql : select * from my_table where $val between col1 and coL2; …

php mysql laravel eloquent query-builder
Laravel merge relationships

Is there a way to merge 2 relationships in laravel? this is the way it's setup now, but Is there a …

php laravel-4 eloquent relationships
Laravel eloquent - One to many relationships

I have just got started with laravel v3 and am trying to wrap my head around eloquent's One-To-Many relationships by …

php laravel eloquent laravel-3
Laravel: Querying and accessing child objects in nested relationship with where clauses

I am trying to access the child objects of nested relationships that return many results from the parents object. Let's …

laravel nested eloquent relationships
How to GROUP and SUM a pivot table column in Eloquent relationship?

In Laravel 4; I have model Project and Part, they have a many-to-many relationship with a pivot table project_part. The …

laravel laravel-4 eloquent relationships