Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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