app/Http/Controllers/Admin/LanguagesController.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)
    {
        $keywords = $request->get('keywords');
        if(empty($keywords))
            $languages = Language::orderBy('id', 'desc')->paginate(5);
        else
            $languages = Language::where('name', 'LIKE', '%'. $keywords .'%')->orderBy('id', 'desc')->paginate(5);
        return view('admin.language.index', ['languages' => $languages]);
    }
public function index ( Request $ request ) { $ keywords = $ request -> get ( 'keywords' ) ; if ( empty ( $ keywords ) ) $ languages = Language :: orderBy ( 'id' , 'desc' ) -> paginate ( 5 ) ; else $ languages = Language :: where ( 'name' , 'LIKE' , '%' . $ keywords . '%' ) -> orderBy ( 'id' , 'desc' ) -> paginate ( 5 ) ; return view ( 'admin.language.index' , [ 'languages' => $ languages ] ) ; }
Display a listing of the resource.
Display a listing of the resource .
//$languages = DB::table('languages')->paginate(5); // $keywords = Input::get('keywords');