sql concatenate two columns – How to Concat First Name and Last Name in Laravel?

sql concatenate two columns with Concat First Name and Last Name in laravel db select query with Controller Code bellow.

sql concatenate two columns

you are trying to separate the first name and last name from a full name, currently using the following laravel source code.

Example 1: Concat First Name and Last Name

Laravel Controller Code:

get();
  
        dd($members);
    }
}

Result

Array
(
    [0] => Array
        (
            [id] => 126
            [full_name] => Ridham Bhanderi
        )
    [1] => Array
        (
            [id] => 127
            [full_name] => Ridham Kakadiya
        )
)

Don’t miss : laravel search query

Example 2: Concat First Name, Middle Name and Last Name

Laravel Controller Code:

get();
  
        dd($members);
    }
}

Result

Array
(
    [0] => Array
        (
            [id] => 126
            [full_name] => Ridham Karshanbhai Bhanderi
        )
    [1] => Array
        (
            [id] => 127
            [full_name] => Ridham Karshanbhai Kakadiya
        )
)

I hope you get an idea about sql concatenate two columns.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment