app/Http/Controllers/CategoryController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(CreateCategoryRequest $request)
    {
       Category::create([
        'name'=>$request->name,
 ]);
return redirect(route('categories.index'));
    }
public function store ( CreateCategoryRequest $ request ) { Category :: create ( [ 'name' => $ request -> name , ] ) ; return redirect ( route ( 'categories.index' ) ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .