Top "Eloquent" questions

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

How do you check "if not null" with Eloquent?

How do you check if a field is not null with Eloquent? I tried Model::where('sent_at', 'IS NOT', …

laravel eloquent
Laravel Eloquent - distinct() and count() not working properly together

So I'm trying to get the number of distinct pids on a query, but the returned value is wrong. This …

laravel count eloquent distinct
Eloquent - where not equal to

I'm currently using the latest Laravel version. I've tried the following queries: Code::where('to_be_used_by_user_id', …

laravel eloquent
Get Specific Columns Using “With()” Function in Laravel Eloquent

I have two tables, User and Post. One User can have many posts and one post belongs to only one …

php laravel orm eloquent laravel-query-builder
Laravel Eloquent Sum of relation's column

I've been working on a shoppingcart application and now I've come to the following issue.. There is a User, a …

php laravel eloquent relation
Laravel - Eloquent "Has", "With", "WhereHas" - What do they mean?

I've found the concept and meaning behind these methods to be a little confusing, is it possible for somebody to …

laravel orm eloquent relational-database relationship
Laravel Eloquent "WHERE NOT IN"

I'm having trouble to write query in laravel eloquent ORM. my query is SELECT book_name,dt_of_pub,pub_…

laravel laravel-4 eloquent
Laravel - Eloquent or Fluent random row

How can I select a random row using Eloquent or Fluent in Laravel framework? I know that by using SQL, …

php laravel random eloquent fluent
How to do this in Laravel, subquery where in

How can I make this query in Laravel: SELECT `p`.`id`, `p`.`name`, `p`.`img`, `p`.`safe_name`, `p`.`sku`, `…

php mysql laravel eloquent subquery
Disable Laravel's Eloquent timestamps

I'm in the process of converting one of our web applications from CodeIgniter to Laravel. However at this moment we …

php laravel eloquent