app/Http/Controllers/admin/CollectController.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(Request $request)
    {
        $id = $request -> input('search');
        if($id){
            $data = Collect::where('uid',$id)->paginate(8)->appends($request->input());
        }else{
            $data = Collect::paginate(8)->appends($request->input());
        }
        $collect = Collect::all();
        return view('admin.collect.index',['title'=>'商品收藏列表','data'=>$data,'collect'=>$collect]);
    }
public function index ( Request $ request ) { $ id = $ request -> input ( 'search' ) ; if ( $ id ) { $ data = Collect :: where ( 'uid' , $ id ) -> paginate ( 8 ) -> appends ( $ request -> input ( ) ) ; } else { $ data = Collect :: paginate ( 8 ) -> appends ( $ request -> input ( ) ) ; } $ collect = Collect :: all ( ) ; return view ( 'admin.collect.index' , [ 'title' => '商品收藏列表','data'=>$da t a,'col le c t'=> $ collect]) ; }
Display a listing of the resource.
Display a listing of the resource .