app/Http/Controllers/DateController.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)
    {
        $date = request()->validate([
            'nomcliente' => 'required',
            'appcliente' => 'required',
            'fechacita' => 'required',
            'horacita' => 'required',
            'tipomascota' => 'required',
            'nommascota' => 'required',
            'observacion' => 'required|min:3',
        ]);
        $date = new Date;
        $date->nomcliente = $request->input('nomcliente');
        $date->appcliente = $request->input('appcliente');
        $date->fechacita = $request->input('fechacita');
        $date->horacita = $request->input('horacita');
        $date->tipomascota = $request->input('tipomascota');
        $date->nommascota = $request->input('nommascota');
        $date->observacion = $request->input('observacion');
        $date->save();
        return redirect()->route('citas') ->with('info','Cita creada con éxito');
    }
public function store ( Request $ request ) { $ date = request ( ) -> validate ( [ 'nomcliente' => 'required' , 'appcliente' => 'required' , 'fechacita' => 'required' , 'horacita' => 'required' , 'tipomascota' => 'required' , 'nommascota' => 'required' , 'observacion' => 'required|min:3' , ] ) ; $ date = new Date ; $ date -> nomcliente = $ request -> input ( 'nomcliente' ) ; $ date -> appcliente = $ request -> input ( 'appcliente' ) ; $ date -> fechacita = $ request -> input ( 'fechacita' ) ; $ date -> horacita = $ request -> input ( 'horacita' ) ; $ date -> tipomascota = $ request -> input ( 'tipomascota' ) ; $ date -> nommascota = $ request -> input ( 'nommascota' ) ; $ date -> observacion = $ request -> input ( 'observacion' ) ; $ date -> save ( ) ; return redirect ( ) -> route ( 'citas' ) -> with ( 'info' , 'Cita creada con éxito') ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// return 'Cita creada con éxito';