Skip to content

Instantly share code, notes, and snippets.

@gentritabazi
Created November 2, 2020 14:33
Show Gist options
  • Save gentritabazi/157d10328f86db3a270701e12c511327 to your computer and use it in GitHub Desktop.
Save gentritabazi/157d10328f86db3a270701e12c511327 to your computer and use it in GitHub Desktop.
<?php
namespace Infrastructure\Http\Middlewares;
use Closure;
class SwaggerProtect
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public function handle($request, Closure $next)
{
if (app()->environment('production') || app()->environment('staging')) {
abort(404);
}
return $next($request);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment