app/Http/Controllers/Admin/front/ServiceController.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()
    {
        $services = Service::orderBy('id');
        $this->search = [
            'title' =>\request()->get('title') ,
        ];
        if ($this->search['title']){
            $services->where('title' , 'like' , "%{$this->search['title']}%");
        }
        $services=$services->paginate(10)->appends($this->search);
        return view('frontend.service.index')->with('services',$services);
    }
public function index ( ) { $ services = Service :: orderBy ( 'id' ) ; $ this -> search = [ 'title' => \ request ( ) -> get ( 'title' ) , ] ; if ( $ this -> search [ 'title' ] ) { $ services -> where ( 'title' , 'like' , " % { $ this -> search [ 'title' ] } % " ) ; } $ services = $ services -> paginate ( 10 ) -> appends ( $ this -> search ) ; return view ( 'frontend.service.index' ) -> with ( 'services' , $ services ) ; }
Display a listing of the resource.
Display a listing of the resource .