planifibot/app/Http/Controllers/EventoController.php

97 lines
2.0 KiB
PHP

<?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
* @return \Illuminate\Http\RedirectResponse
*/
public function store(Request $request)
{
$request->validate([
'nombre' => 'required',
]);
$evento = new Evento();
$evento->nombre = $request->input("nombre");
$evento->save();
return redirect()->route("edit", ['evento' => $evento]);
}
/**
* 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)
{
return view("edit", ['evento' => $evento]);
}
/**
* 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)
{
//
}
public function prueba()
{
return view("prueba");
}
}