-
-
Save parzibyte/117b4662d259ceeaad5ac0e4dc705b2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Web Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register web routes for your application. These | |
| routes are loaded by the RouteServiceProvider within a group which | |
| contains the "web" middleware group. Now create something great! | |
| | |
*/ | |
/** | |
* Recomiendo: | |
* Rutas parte 1: https://parzibyte.me/blog/2019/02/14/explicando-rutas-web-laravel-5-7/ | |
* Rutas parte 2: https://parzibyte.me/blog/2019/02/20/rutas-laravel-parte-2-prefijos-fallback-limite-de-tasa-formularios/ | |
*/ | |
# Cuando se solicita la url /, es decir, la raíz | |
Route::get('/', "CancionesController@index") | |
->name("inicio"); | |
# Mostrar el formulario para agregar | |
Route::view("/agregar", "nueva_cancion") | |
->name("formAgregar"); | |
# Cuando se envía el formulario y se debe guardar la canción | |
Route::post("/agregar", "CancionesController@agregarCancion") | |
->name("agregarCancion"); | |
# Cuando se guardan los cambios en la base de datos | |
Route::post("/guardarCambios", "CancionesController@guardarCambiosDeCancion") | |
->name("guardarCambiosDeCancion"); | |
# Mostrar el formulario para editar la canción, algo como editar/1 | |
Route::get("/editar/{id}", "CancionesController@editarCancion") | |
->name("editarCancion"); | |
# URL que es llamada para eliminar canción, algo como eliminar/1 | |
Route::get("/eliminar/{id}", "CancionesController@eliminarCancion") | |
->name("eliminarCancion"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment