How to make a concatenate in Laravel select using Query Builder

If you want to make a concatenate between 2 columns inside of your select in Laravel you can simply use DB::raw(‘CONCAT(…

Here is an example

          DB::raw('CONCAT(first_name," ",last_name) as full_name')

Leave a Reply

Your email address will not be published. Required fields are marked *