app/Http/Controllers/UserController.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)
    {
        $keyword = $request->keyword;
        $pagination = 5;
        $user = User::where("nama","LIKE","%$keyword%")
                ->orWhere("level","LIKE","%$keyword%")
                ->paginate($pagination);
                $user->withPath('user');
                $user->appends($request->all);
                return view('pages.user.index', compact('user'))->with('i', ($request->input('page', 1)-1) * $pagination);
    }
public function index ( Request $ request ) { $ keyword = $ request -> keyword ; $ pagination = 5 ; $ user = User :: where ( " nama " , " LIKE " , " % $ keyword % " ) -> orWhere ( " level " , " LIKE " , " % $ keyword % " ) -> paginate ( $ pagination ) ; $ user -> withPath ( 'user' ) ; $ user -> appends ( $ request -> all ) ; return view ( 'pages.user.index' , compact ( 'user' ) ) -> with ( 'i' , ( $ request -> input ( 'page' , 1 ) - 1 ) * $ pagination ) ; }
Display a listing of the resource.
Display a listing of the resource .