app/Http/Controllers/EventoController.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)
    {
        $input = $request->all();
        $evento = Evento::create($input);
        $emailRegistro = new EmailRegistro();
        $emailRegistro->titulo = 'Gracias por su registro';
        $emailRegistro->contenido = 'Gracias por registrarte';
        $emailRegistro->id_evento = $evento->id;
        $emailRegistro->save();
        $id = DB::getPdo()->lastInsertId();
        return response()->json([
            'res'=>true,
            'message'=>'Evento creado correctamente'
        ], 200);
    }
public function store ( Request $ request ) { $ input = $ request -> all ( ) ; $ evento = Evento :: create ( $ input ) ; $ emailRegistro = new EmailRegistro ( ) ; $ emailRegistro -> titulo = 'Gracias por su registro' ; $ emailRegistro -> contenido = 'Gracias por registrarte' ; $ emailRegistro -> id_evento = $ evento -> id ; $ emailRegistro -> save ( ) ; $ id = DB :: getPdo ( ) -> lastInsertId ( ) ; return response ( ) -> json ( [ 'res' => true , 'message' => 'Evento creado correctamente' ] , 200 ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .