From 2337ad9a37af9c2629ee87d835f267ebb69ad8a2 Mon Sep 17 00:00:00 2001 From: ale Date: Sat, 14 Sep 2024 13:37:06 -0300 Subject: [PATCH] Login de compras funcionando --- app/Http/Controllers/ComprasController.php | 2 +- app/Http/Middleware/Compras.php | 2 +- resources/js/components/LoginCompras.vue | 2 +- routes/web.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/ComprasController.php b/app/Http/Controllers/ComprasController.php index 0104a7e..7cc60c3 100644 --- a/app/Http/Controllers/ComprasController.php +++ b/app/Http/Controllers/ComprasController.php @@ -12,7 +12,7 @@ class ComprasController return response()->download($file); } - public function showLoginForm() + public function show() { return view('auth/compras_login'); } diff --git a/app/Http/Middleware/Compras.php b/app/Http/Middleware/Compras.php index d3a81ad..a9d9f6b 100644 --- a/app/Http/Middleware/Compras.php +++ b/app/Http/Middleware/Compras.php @@ -18,7 +18,7 @@ class Compras public function handle(Request $request, Closure $next) { if (!Auth::check()) - return redirect()->route('compras.login'); + return redirect()->route('compras_login.show'); if (Auth::user()->is_compras) { return $next($request); diff --git a/resources/js/components/LoginCompras.vue b/resources/js/components/LoginCompras.vue index b68a95e..23d1133 100644 --- a/resources/js/components/LoginCompras.vue +++ b/resources/js/components/LoginCompras.vue @@ -4,7 +4,7 @@
- +
diff --git a/routes/web.php b/routes/web.php index 147ffc0..6872466 100644 --- a/routes/web.php +++ b/routes/web.php @@ -76,7 +76,7 @@ Route::middleware('auth')->group( function() { }); }); -Route::get('/compras/login', 'ComprasController@showLoginForm')->name('compras.login'); +Route::get('/compras', 'ComprasController@show')->name('compras_login.show'); Route::middleware(['compras'])->group( function() { Route::get('/compras/pedidos', 'ComprasController@pedidos')->name('compras.pedidos');