Top "Eloquent" questions

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

How do I get a "select count(*) group by" using laravel eloquent

I would like to execute the follow sentence using laravel eloquent SELECT *, count(*) FROM reserves group by day The only …

laravel laravel-5 eloquent query-builder
Laravel - Querybuilder with join and concat

Im trying to pull all users from the users table who match a certain group in the users_groups pivot …

php mysql laravel-4 eloquent query-builder
Laravel OrderBy relationship count

I'm trying to get the most popular hackathons which requires ordering by the respective hackathon's partipants->count(). Sorry if …

php mysql laravel eloquent
Eloquent where condition based on a "belongs to" relationship

Let's say I have the following model: class Movie extends Eloquent { public function director() { return $this->belongsTo('Director'); } } Now …

laravel where eloquent belongs-to
Laravel Eloquent Ignore Casing

I am trying to run a query using Eloquent the $vars['language'] is in lower case but the language column …

mysql orm laravel eloquent lowercase
Laravel Relationships

I've been looking over relationships in Laravel 4 in the documentation and I'm trying to work out the following. I have …

laravel belongs-to relationships laravel-4 eloquent
Laravel Soft Delete restore() Error

The following soft delete code works fine for me: $post = Post::find($post_id); $post->delete(); The deleted_at …

laravel eloquent soft-delete
Laravel 5 Querying with relations causes "Call to a member function addEagerConstraints() on null" error

I have been trying to create a simple user management system but keep on hitting road blocks when it comes …

php mysql laravel laravel-5 eloquent
Laravel Eloquent skip n, take all?

I've noticed that in Laravel when chaining a skip() you must also use take() as well. I want to skip …

php laravel eloquent offset
Eloquent select rows with empty string or null value

I have something like $user->albums()->where('col', NULL), it works fine then I tried to extend …

php orm relationship eloquent