app/Http/Controllers/soporte/NovedadController.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([
        'especificar'=>'required',
         'novedadopercance'=>'required','cliente_id'=>'required']);
        try {
             $novedad =new Novedad();
             $novedad->cliente_id=$request->cliente_id;
             $novedad->novedadopercance=$request->novedadopercance;
             $novedad->horainciar= now(); 
             $novedad->especificar=$request->especificar;
             $novedad->save();
       return redirect()->route('novedads.index');    
    }catch(\Exception $exception){
        return  redirect()->back()->with('error',"Error".$exception->getMessage());
    }
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'especificar' => 'required' , 'novedadopercance' => 'required' , 'cliente_id' => 'required' ] ) ; try { $ novedad = new Novedad ( ) ; $ novedad -> cliente_id = $ request -> cliente_id ; $ novedad -> novedadopercance = $ request -> novedadopercance ; $ novedad -> horainciar = now ( ) ; $ novedad -> especificar = $ request -> especificar ; $ novedad -> save ( ) ; return redirect ( ) -> route ( 'novedads.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 .