Created
July 7, 2020 20:35
-
-
Save parzibyte/f5a99868223ae4eb363bfc9250a44cd5 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 | |
namespace App\Http\Middleware; | |
use Closure; | |
class MiMiddleware | |
{ | |
/** | |
* Handle an incoming request. | |
* | |
* @param \Illuminate\Http\Request $request | |
* @param \Closure $next | |
* @return mixed | |
*/ | |
public function handle($request, Closure $next) | |
{ | |
$ruta = $request->route()->getName(); | |
if($ruta === "descargar_lista_precios"){ | |
# Ok, que pase | |
return $next($request); | |
} else { | |
// Permiso denegado | |
abort(403); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment