Top "Eloquent" questions

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

How to Create Multiple Where Clause Query Using Laravel Eloquent?

I'm using the Laravel Eloquent query builder and I have a query where I want a WHERE clause on multiple …

php laravel eloquent laravel-query-builder
Get the Last Inserted Id Using Laravel Eloquent

I'm currently using the below code to insert data in a table: <?php public function saveDetailsCompany() { $post = Input::All(); $…

php database laravel eloquent
Laravel Checking If a Record Exists

I am new to Laravel. Please excuse the newbie question but how do I find if a record exists? $user = …

php laravel laravel-5 eloquent conditional
Laravel 4: how to "order by" using Eloquent ORM

Simple question - how do I order by 'id' descending in Laravel 4. The relevant part of my controller looks like …

php laravel laravel-4 eloquent
Laravel 4 Eloquent Query Using WHERE with OR AND OR?

How do I say WHERE (a = 1 OR b =1 ) AND (c = 1 OR d = 1) For more complicated queries am I supposed to …

php laravel eloquent laravel-query-builder
How to select specific columns in laravel eloquent

lets say I have 7 columns in table, and I want to select only two of them, something like this SELECT `…

laravel laravel-5 orm eloquent
Select Last Row in the Table

I would like to retrieve the last file inserted into my table. I know that the method first() exists and …

laravel eloquent
Creating and Update Laravel Eloquent

What's the shorthand for inserting a new record or updating if it exists? <?php $shopOwner = ShopMeta::where('shopId', '=…

php laravel eloquent laravel-query-builder
Eloquent Collection: Counting and Detect Empty

This may be a trivial question but I am wondering if Laravel recommends a certain way to check whether an …

laravel laravel-4 eloquent laravel-collection
Laravel Eloquent groupBy() AND also return count of each group

I have a table that contains, amongst other columns, a column of browser versions. And I simply want to know …

laravel laravel-4 eloquent