app/Http/Controllers/recursoshumanos/rrhareacontroller.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)
    { $request->validate([
        'nombre'=>'required']);
        try {
                $areas =new Rrharea();
                $areas->nombre=$request->nombre;
                $areas->save();
          return redirect()->route('rhareas.index');
        } catch (\Exception $exception) {
            return  redirect()->back()->with('error', "Error" . $exception->getMessage());
        }
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'nombre' => 'required' ] ) ; try { $ areas = new Rrharea ( ) ; $ areas -> nombre = $ request -> nombre ; $ areas -> save ( ) ; return redirect ( ) -> route ( 'rhareas.index' ) ; } catch ( \ Exception $ exception ) { return redirect ( ) -> back ( ) -> with ( 'error' , " Error " . $ exception -> getMessage ( ) ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .
//