Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 6, 2020 20:28
Show Gist options
  • Save parzibyte/bd2088cece013bd91ace122fbc4c0c9a to your computer and use it in GitHub Desktop.
Save parzibyte/bd2088cece013bd91ace122fbc4c0c9a to your computer and use it in GitHub Desktop.
<?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