Rutas de login de ollas
This commit is contained in:
parent
7526ab300c
commit
c56f67ca85
3 changed files with 23 additions and 2 deletions
11
app/Http/Controllers/OllasController.php
Normal file
11
app/Http/Controllers/OllasController.php
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
class OllasController extends Controller
|
||||||
|
{
|
||||||
|
public function show()
|
||||||
|
{
|
||||||
|
return view('auth/login');
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,16 +3,17 @@
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class Authenticate extends Middleware
|
class Authenticate extends Middleware
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Get the path the user should be redirected to when they are not authenticated.
|
* Get the path the user should be redirected to when they are not authenticated.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param Request $request
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
protected function redirectTo($request)
|
protected function redirectTo($request): string
|
||||||
{
|
{
|
||||||
if (!$request->expectsJson()) {
|
if (!$request->expectsJson()) {
|
||||||
$path = $request->path();
|
$path = $request->path();
|
||||||
|
@ -20,7 +21,10 @@ class Authenticate extends Middleware
|
||||||
return route('admin.login');
|
return route('admin.login');
|
||||||
if (preg_match('~^comisiones.*~i', $path))
|
if (preg_match('~^comisiones.*~i', $path))
|
||||||
return route('comisiones.login');
|
return route('comisiones.login');
|
||||||
|
if (preg_match('~^ollas.*~i', $path))
|
||||||
|
return route('ollas.login');
|
||||||
return route('login');
|
return route('login');
|
||||||
}
|
}
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,3 +56,9 @@ Route::middleware(['auth', 'role:comision'])->group( function() {
|
||||||
Route::post('/comisiones/canasta', 'ComisionesController@cargarCanasta')->name('comisiones.canasta');
|
Route::post('/comisiones/canasta', 'ComisionesController@cargarCanasta')->name('comisiones.canasta');
|
||||||
Route::post('/comisiones/saldos', 'ComisionesController@cargarSaldos')->name('comisiones.saldos');
|
Route::post('/comisiones/saldos', 'ComisionesController@cargarSaldos')->name('comisiones.saldos');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('/ollas/login', 'OllasController@show')->name('ollas.login');
|
||||||
|
|
||||||
|
Route::middleware(['auth', 'role:olla'])->group( function() {
|
||||||
|
Route::get('/ollas', 'RouteController@main')->name('ollas');
|
||||||
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue