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)
    {
        $validatedData = $request->validate([
            'name' => 'bail|required|unique:categories|max:255',
        ]);
        Category::create([
            'name' => $request->get('name'),
        ]);
        return redirect('/gerencias/index')->with('status', 'Nuevo Gerencia registrado.');
    }
public function store ( Request $ request ) { $ validatedData = $ request -> validate ( [ 'name' => 'bail|required|unique:categories|max:255' , ] ) ; Category :: create ( [ 'name' => $ request -> get ( 'name' ) , ] ) ; return redirect ( '/gerencias/index' ) -> with ( 'status' , 'Nuevo Gerencia registrado.' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .