app/Http/Controllers/PostController.php
/**
     * Search a Post in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Search a Post in storage.
Search a Post in storage .
public function search(Request $request)
    {        
         $filters = $request->except('_token');
         $posts = Post::where('title','ILIKE', "%{$request->search}%")
                       ->orWhere('content','ILIKE', "%{$request->search}%")
                       ->orderBy('id','ASC')->paginate(15);   
         return view('admin.posts.index', compact('posts','filters'));
    }
public function search ( Request $ request ) { $ filters = $ request -> except ( '_token' ) ; $ posts = Post :: where ( 'title' , 'ILIKE' , " % { $ request -> search } % " ) -> orWhere ( 'content' , 'ILIKE' , " % { $ request -> search } % " ) -> orderBy ( 'id' , 'ASC' ) -> paginate ( 15 ) ; return view ( 'admin.posts.index' , compact ( 'posts' , 'filters' ) ) ; }
Search a Post in storage.
Search a Post in storage .