I have a table ('mbo_party') where has two column first and last (I have used first to store firstname, last to store lastname). Suppose I store Debanjan in column 'first' and Ganguly in 'last'. So in search field if one search by 'Debanjan Ganguly', how do I get all the data from that column. I am using laravel 5.4, I am not using any model. I write query in my controller. Here's my code so far...
Controller
$party_name = $request->get('party_name');
$query = DB::table('mbo_party')->where('concat(first," ",last)' , '=' , $party_name)->first();
View
<form id="party_search_it" method="GET" action="{{route('mbo-index')}}">
{{ csrf_field() }}
<input type="text" class="form-control" name="party_name" placeholder="Search for Party Name..." autocomplete="off">
</form>
My Table View Here's my Table View
In this method when I am using echo in controller , it is showing blank.
echo"<pre>";print_r($query);die;
I want to know what is correct syntax for performing this kind of operation