app/Http/Controllers/recursoshumanos/rrhtipocontratocontroller.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([
            'descripcion'=>'required']);
            try {
                    $tipocontrato =new Rrhtipocontrato();
                    $tipocontrato->descripcion=$request->descripcion;
                    $tipocontrato->save();
              return redirect()->route('rhtipocontratos.index');
            } catch (\Exception $exception) {
                return  redirect()->back()->with('error', "Error" . $exception->getMessage());
            }
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'descripcion' => 'required' ] ) ; try { $ tipocontrato = new Rrhtipocontrato ( ) ; $ tipocontrato -> descripcion = $ request -> descripcion ; $ tipocontrato -> save ( ) ; return redirect ( ) -> route ( 'rhtipocontratos.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 .
// //