app/Http/Controllers/CategoriesController.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)
    {
         $categories=Category::search($request->name)
                    ->orderBy('name','ASC')
                    ->paginate(10);
        return view('admin.categories.index')
                ->with('categories',$categories)
                ->with('name',$request->name);
    }
public function index ( Request $ request ) { $ categories = Category :: search ( $ request -> name ) -> orderBy ( 'name' , 'ASC' ) -> paginate ( 10 ) ; return view ( 'admin.categories.index' ) -> with ( 'categories' , $ categories ) -> with ( 'name' , $ request -> name ) ; }
Display a listing of the resource.
Display a listing of the resource .