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(Request $request)
    {
        $this->validate($request, [
            'name' => 'required|string|max:255',
        ]);
        Category::create($request->all());
        return redirect('/admin/categories')->with('success', 'Category Added Successfully');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'name' => 'required|string|max:255' , ] ) ; Category :: create ( $ request -> all ( ) ) ; return redirect ( '/admin/categories' ) -> with ( 'success' , 'Category Added Successfully' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .