“Suche in Laravel 8” Code-Antworten

Laravel -Suche erstellen

public function index(){
      // // we need to show all data from "blog" table
      // $blogs = Blog::all();
      // // show data to our view
      // return view('blog.index',['blogs' => $blogs]);

      $search = Request::get('search');
      $blogs = Blog::where('title','like','%'.$search.'%')->orderBy('id')->paginate(6);
      return view('blog.index',['blogs' => $blogs]);
    }
SAMER SAEID

Suche in Laravel 8

public function index(){
      // // we need to show all data from "blog" table
      // $blogs = Blog::all();
      // // show data to our view
      // return view('blog.index',['blogs' => $blogs]);

      $search = Request::get('search');
      $blogs = Blog::where('title','like','%'.$search.'%')->orderBy('id')->paginate(6);
      return view('blog.index',['blogs' => $blogs]);
    }
Precious Peacock

Suche Laravel

// Employee Model
public function searchResult($search)
{
  $query = DB::table("employee") ->where('employee_name', 'LIKE', '%'.$search.'%')->get();
  return $query;
}
Anak Daeng

Laravel -Suchfunktion

$users = User::has('posts')->withCount('posts')->orderBy('posts_count')->take(50)->get();

$userIndex = $users->search(function($user) {
    return $user->id === Auth::id();
});
Mohamad

Ähnliche Antworten wie “Suche in Laravel 8”

Fragen ähnlich wie “Suche in Laravel 8”

Weitere verwandte Antworten zu “Suche in Laravel 8” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen