Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

blade search pagination

Route::any ( '/search', function () {
 $q = Input::get ( 'q' );
 if($q != ""){
 $user = User::where ( 'name', 'LIKE', '%' . $q . '%' )->orWhere ( 'email', 'LIKE', '%' . $q . '%' )->paginate (5)->setPath ( '' );
 $pagination = $user->appends ( array (
    'q' => Input::get ( 'q' ) 
  ) );
 if (count ( $user ) > 0)
  return view ( 'welcome' )->withDetails ( $user )->withQuery ( $q );
 }
  return view ( 'welcome' )->withMessage ( 'No Details found. Try to search again !' );
} );
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #blade #search #pagination
ADD COMMENT
Topic
Name
1+8 =