Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 7, 2020 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/f5a99868223ae4eb363bfc9250a44cd5 to your computer and use it in GitHub Desktop.
Save parzibyte/f5a99868223ae4eb363bfc9250a44cd5 to your computer and use it in GitHub Desktop.
<?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