Tag : Mysql Concat


How to select concat columns with Laravel Query Builder?

We are always wanted to use sql query for concatenate fullname or something to concat using mysql concat function, now if you think how to use concat function in laravel query builder then this post can help you. So, if you need to use concat mysql function then see bellow example: <strong>Example:</strong> <pre class="prettyprint lang-php"> $user = User::select("users.*" ,DB::raw("CONCAT(users.first_name,' ',users.last_name) as full_name")) ->get(); print_r($user); </pre>

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

    Laravel 5.4 New Feature - Add new Components & Slots in Blade Template

    Laravel 5.4 New Feature - Add new Components & Slots in Blade Template

    Open Post

    Laravel - How to make subquery in select statement?

    Laravel - How to make subquery in select statement?

    Open Post

    Laravel 5 - How to create custom error page with example

    Laravel 5 - How to create custom error page with example

    Open Post

    How to create Laravel Resource Controller example?

    How to create Laravel Resource Controller example?

    Open Post

    Laravel 5 - Grayscale Image Generate Example from scratch

    Laravel 5 - Grayscale Image Generate Example from scratch

    Open Post

    Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 1

    Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 1

    Open Post