app/Http/Controllers/Admin/front/ProjectController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $projects = Project::orderBy('id');
        $this->search = [
            'title' =>\request()->get('title') ,
        ];
        if ($this->search['title']){
            $projects->where('title' , 'like' , "%{$this->search['title']}%");
        }
        $projects=$projects->paginate(10)->appends($this->search);
        return view('frontend.project.index')->with('projects',$projects);
    }
public function index ( ) { $ projects = Project :: orderBy ( 'id' ) ; $ this -> search = [ 'title' => \ request ( ) -> get ( 'title' ) , ] ; if ( $ this -> search [ 'title' ] ) { $ projects -> where ( 'title' , 'like' , " % { $ this -> search [ 'title' ] } % " ) ; } $ projects = $ projects -> paginate ( 10 ) -> appends ( $ this -> search ) ; return view ( 'frontend.project.index' ) -> with ( 'projects' , $ projects ) ; }
Display a listing of the resource.
Display a listing of the resource .