Top "Laravel-query-builder" questions

The database query builder provides a convenient, fluent interface to creating and running database queries in Laravel apps.

How Do I Get the Query Builder to Output Its Raw SQL Query as a String?

Given the following code: DB::table('users')->get(); I want to get the raw SQL query string that …

php sql laravel laravel-4 laravel-query-builder
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
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
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
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
How to Use Order By for Multiple Columns in Laravel 4?

I want to sort multiple columns in Laravel 4 by using the method orderBy() in Laravel Eloquent. The query will be …

php laravel laravel-4 eloquent laravel-query-builder
Get the Query Executed in Laravel 3/4

How can I retrieve the raw executed SQL query in Laravel 3/4 using Laravel Query Builder or Eloquent ORM? For example, …

php laravel orm eloquent laravel-query-builder
A JOIN With Additional Conditions Using Query Builder or Eloquent

I'm trying to add a condition using a JOIN query with Laravel Query Builder. <?php $results = DB::select(' …

laravel laravel-4 laravel-query-builder
How to change date format in laravel Query Builder from "2016-03-12" to "12-Mar-2016"

How to change date-format in laravel from "2016-03-12" to "12-Mar-2016" $results = DB::table('customers as cust') ->where(…

php laravel laravel-5 laravel-query-builder
laravel querybuilder how to use like in wherein function

$book = array('book1','book2'); $book array elements numbers are variable. it might have 2 element or 20 elements I need …

php laravel-5 laravel-query-builder