2021-07-14 21:50:34 -03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use App\Models\Evento;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
class EventoController extends Controller
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Display a listing of the resource.
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
*/
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show the form for creating a new resource.
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
*/
|
|
|
|
public function create()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Store a newly created resource in storage.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Http\Request $request
|
2021-08-04 20:54:19 -03:00
|
|
|
* @return \Illuminate\Http\RedirectResponse
|
2021-07-14 21:50:34 -03:00
|
|
|
*/
|
|
|
|
public function store(Request $request)
|
|
|
|
{
|
2021-08-04 20:54:19 -03:00
|
|
|
$request->validate([
|
|
|
|
'nombre' => 'required',
|
|
|
|
]);
|
|
|
|
$evento = new Evento();
|
|
|
|
$evento->nombre = $request->input("nombre");
|
|
|
|
$evento->save();
|
|
|
|
return redirect()->route("edit", ['evento' => $evento]);
|
2021-07-14 21:50:34 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display the specified resource.
|
|
|
|
*
|
|
|
|
* @param \App\Models\Evento $evento
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
*/
|
|
|
|
public function show(Evento $evento)
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show the form for editing the specified resource.
|
|
|
|
*
|
|
|
|
* @param \App\Models\Evento $evento
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
*/
|
|
|
|
public function edit(Evento $evento)
|
|
|
|
{
|
2021-08-04 20:54:19 -03:00
|
|
|
return view("edit", ['evento' => $evento]);
|
2021-07-14 21:50:34 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the specified resource in storage.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param \App\Models\Evento $evento
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
*/
|
|
|
|
public function update(Request $request, Evento $evento)
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove the specified resource from storage.
|
|
|
|
*
|
|
|
|
* @param \App\Models\Evento $evento
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
*/
|
|
|
|
public function destroy(Evento $evento)
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
2021-08-04 20:54:19 -03:00
|
|
|
|
|
|
|
public function prueba()
|
|
|
|
{
|
|
|
|
return view("prueba");
|
|
|
|
}
|
2021-07-14 21:50:34 -03:00
|
|
|
}
|