Skip to content

Instantly share code, notes, and snippets.

@parzibyte parzibyte/web.php

Created Mar 6, 2020
Embed
What would you like to do?
<?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
You can’t perform that action at this time.