Created
March 6, 2020 20:28
-
-
Save parzibyte/bd2088cece013bd91ace122fbc4c0c9a 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 | |
use Illuminate\Support\Facades\Auth; | |
use Illuminate\Support\Facades\Route; | |
/* | |
|-------------------------------------------------------------------------- | |
| 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! | |
| | |
*/ | |
Route::get('/', function () { | |
return redirect()->route("home"); | |
}); | |
Route::get("/acerca-de", function () { | |
return view("misc.acerca_de"); | |
})->name("acerca_de"); | |
Auth::routes([ | |
"reset" => false,// no pueden olvidar contraseña | |
]); | |
Route::get('/home', 'HomeController@index')->name('home'); | |
// Permitir logout con petición get | |
Route::get("/logout", function () { | |
Auth::logout(); | |
return redirect()->route("home"); | |
})->name("logout"); | |
Route::middleware("auth") | |
->group(function () { | |
Route::resource("productos", "ProductosController"); | |
Route::get("/ventas/ticket", "VentasController@ticket")->name("ventas.ticket"); | |
Route::resource("ventas", "VentasController"); | |
Route::get("/vender", "VenderController@index")->name("vender.index"); | |
Route::post("/productoDeVenta", "VenderController@agregarProductoVenta")->name("agregarProductoVenta"); | |
Route::delete("/productoDeVenta", "VenderController@quitarProductoDeVenta")->name("quitarProductoDeVenta"); | |
Route::post("/cancelarVenta", "VenderController@cancelarVenta")->name("cancelarVenta"); | |
Route::post("/terminarVenta", "VenderController@terminarVenta")->name("terminarVenta"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment