app/Http/Controllers/CategoriesController.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(CategoryRequest $request)
    {
        $category = new Category($request->all());
        $category->slug = Str::slug($request->name);
        $category->save();
        Flash::success("La categoría <b>$category->name</b>");
        return redirect()->route('categories.index');
    }
public function store ( CategoryRequest $ request ) { $ category = new Category ( $ request -> all ( ) ) ; $ category -> slug = Str :: slug ( $ request -> name ) ; $ category -> save ( ) ; Flash :: success ( " La categoría <b>$ c ategory- >n ame< /b>" ) ; return redirect ( ) -> route ( 'categories.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .