Route::any ( '/search', function () {
$q = Input::get ( 'q' );
if($q != "" ){
$user = Customer::where ( 'email', 'LIKE', '%' . $q . '%' )->orWhere ( 'remarks', 'LIKE', '%' . $q . '%' )->get ();
if (count ( $user ) > 0)
return view ('search')->withDetails ( $user )->withQuery ( $q );
else
return view ('search')->withMessage ( 'Oops' );
};
return view ('search')->withMessage ( 'Oops' );
} );
How can I get the exact search results? For example, if the database consists of multiple phone numbers, the search results will only return the results for my data input (e.g. when I search for “1”, a single number, the database should display “Oops” if no ‘1’ is found and yes if ‘1’ is found. It should not include “x1xxxxx”,”1x”,”xxxxx1″ and so on as the search results. Currently my search results returned me a various data consists of ‘1’. Please help!Thank you!