Top "Eloquent" questions

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

How to Make Laravel Eloquent "IN" Query?

I want to make query in Laravel Eloquent like here its raw MySQL query SELECT * from exampleTbl where id in(1,2,3,4) …

php laravel orm eloquent
Laravel Eloquent where field is X or null

I have a table like this: table - field1: tinyint - field2: varchar (nullable) - datefield: timestamp (nullable) Now I …

php laravel eloquent
Laravel Check If Related Model Exists

I have an Eloquent model which has a related model: public function option() { return $this->hasOne('RepairOption', 'repair_item_…

php laravel laravel-4 eloquent laravel-5
How to select from subquery using Laravel Query Builder?

I'd like to get value by the following SQL using Eloquent ORM. - SQL SELECT COUNT(*) FROM (SELECT * FROM abc …

sql laravel laravel-4 eloquent query-builder
Laravel update model with unique validation rule for attribute

I have a laravel User model which has a unique validation rule on username and email. In my Repository, when …

php laravel validation eloquent
Eloquent ORM laravel 5 Get Array of ids

I'm using Eloquent ORM laravel 5.1, i want to return an array of ids greater than 0, My model called test. I …

php laravel laravel-5 eloquent model
Laravel where on relationship object

I'm developing a web API with Laravel 5.0 but I'm not sure about a specific query I'm trying to build. My …

php laravel eloquent relationship where-clause
Using Eloquent ORM in Laravel to perform search of database using LIKE

I want to use Eloquent's active record building to build a search query, but it is going to be a …

orm laravel eloquent sql-like
Eloquent ->first() if ->exists()

I want to get the first row in table where condition matches: User::where('mobile', Input::get('mobile'))->…

php laravel eloquent
How to select count with Laravel's fluent query builder?

Here is my query using fluent query builder. $query = DB::table('category_issue') ->select('issues.*') ->…

mysql activerecord fluent laravel eloquent