You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
430 B
20 lines
430 B
|
3 days ago
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Middleware;
|
||
|
|
|
||
|
|
use Closure;
|
||
|
|
use Illuminate\Http\Request;
|
||
|
|
|
||
|
|
class SwaggerAccess
|
||
|
|
{
|
||
|
|
public function handle(Request $request, Closure $next)
|
||
|
|
{
|
||
|
|
// Documentation is opt-in and must never be available with debug off.
|
||
|
|
if (!config('app.debug') || !config('app.swagger_enabled') || app()->environment('production')) {
|
||
|
|
abort(404);
|
||
|
|
}
|
||
|
|
|
||
|
|
return $next($request);
|
||
|
|
}
|
||
|
|
}
|