Tag : Join


Laravel 5 - inner join with multiple conditions example using Query Builder

In this post you can learn how to add multiple condition in join query of Laravel Eloquent. if you use data relationship then you don't need to use but if you need to get manually join with two or more condition then it can help. in this example i also add how to add simple inner join in laravel and how to add multiple conditions with inner join i mean using "on" method. You can see bellow example: <strong>Example:</strong> <pre class="prettyprint lang-php"> $user = User::select("users.*","items.id as itemId","jobs.id as jobId") ->join("items","items.user_id","=","users.id") .....

By Hardik Savani | April 30, 2016 | | 13490 Viewer | Category : Laravel
READ MORE

Laravel 5 Join with subquery in Query Builder Example

In this post i want to show you how to use subquery with join in laravel query builder. Whenever you need to use subquery in your laravel project you can use following example and learn hot to use subquery. In bellow example you can see we add subquery using DB::raw(), DB::raw() throught we can select our subtable and after in second argument i added compare your field. That way you can easily fire subquery with laravel 5.2 query builder. <strong>Example:</strong> <pre class="language-sql"> $data = DB::table("items") ->select("items.*","items_count.price_group","items_count.quantity_group") .....

By Hardik Savani | March 2, 2016 | | 26058 Viewer | Category : PHP Laravel
READ MORE

    Laravel 5 amazon s3 file upload tutorial - Part 1

    Laravel 5 amazon s3 file upload tutorial - Part 1

    Open Post

    Laravel guzzle http client POST request example

    Laravel guzzle http client POST request example

    Open Post

    Laravel 5 - line chart example code using google charts API

    Laravel 5 - line chart example code using google charts API

    Open Post

    PHP - Bootstrap autocomplete tokenfield with Ajax Example

    PHP - Bootstrap autocomplete tokenfield with Ajax Example

    Open Post

    How to get last inserted id in Codeigniter?

    How to get last inserted id in Codeigniter?

    Open Post

    Laravel 5 - Full Text Search Example using Scout and Algolia Packages

    Laravel 5 - Full Text Search Example using Scout and Algolia Packages

    Open Post