diff --git a/app/Http/Controllers/EventoController.php b/app/Http/Controllers/EventoController.php index 85838f0..acdb007 100644 --- a/app/Http/Controllers/EventoController.php +++ b/app/Http/Controllers/EventoController.php @@ -31,11 +31,17 @@ class EventoController extends Controller * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response + * @return \Illuminate\Http\RedirectResponse */ public function store(Request $request) { - dd("lo logramos"); + $request->validate([ + 'nombre' => 'required', + ]); + $evento = new Evento(); + $evento->nombre = $request->input("nombre"); + $evento->save(); + return redirect()->route("edit", ['evento' => $evento]); } /** @@ -57,7 +63,7 @@ class EventoController extends Controller */ public function edit(Evento $evento) { - // + return view("edit", ['evento' => $evento]); } /** @@ -82,4 +88,9 @@ class EventoController extends Controller { // } + + public function prueba() + { + return view("prueba"); + } } diff --git a/public/css/edit.css b/public/css/edit.css new file mode 100644 index 0000000..85b7307 --- /dev/null +++ b/public/css/edit.css @@ -0,0 +1,4 @@ +.link { + background-color: white; + border-radius: 5px; +} diff --git a/public/js/edit.js b/public/js/edit.js new file mode 100644 index 0000000..274973a --- /dev/null +++ b/public/js/edit.js @@ -0,0 +1,11 @@ +function copiarEnlace() { + var copyText = document.getElementById("enlace"); + + /* Select the text field */ + copyText.select(); + copyText.setSelectionRange(0, 99999); /* For mobile devices */ + + /* Copy the text inside the text field */ + document.execCommand("copy"); + alert("ok"); +} diff --git a/resources/views/edit.blade.php b/resources/views/edit.blade.php new file mode 100644 index 0000000..3083d9e --- /dev/null +++ b/resources/views/edit.blade.php @@ -0,0 +1,76 @@ + + + + + + + {{$evento->nombre}} - Planifibot + + + + + + + + + + + + + + +
+ @if (Route::has('login')) + + @endif + +
+
+ +
+ +
+
+
+

Invitá gente a "{{$evento->nombre}}" enviándoles este enlace.

+ + +
+ +
+
+ + +
+
+
+
+ +
+
+ Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}) +
+
+
+
+ + diff --git a/resources/views/prueba.blade.php b/resources/views/prueba.blade.php new file mode 100644 index 0000000..32da22f --- /dev/null +++ b/resources/views/prueba.blade.php @@ -0,0 +1,64 @@ + + + + + + + Planifibot + + + + + + + + + + + +
+ @if (Route::has('login')) + + @endif + +
+
+ +
+ +
+
+
+

+ Funcionó +

+
+
+
+ +
+
+ Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}) +
+
+
+
+ + diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 18b6244..55c2526 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -47,14 +47,18 @@
- + @csrf + + @error('nombre') +
El evento precisa nombre.
+ @enderror
- +
diff --git a/routes/web.php b/routes/web.php index f1e20c3..307383b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,7 @@ name('store'); +Route::post('/eventos',[EventoController::class, 'store'])->name('store'); + +Route::get('/eventos/{evento}',[EventoController::class, 'edit'])->name('edit');