TelescopeAuthorize.php
547 Bytes
<?php
namespace App\Support;
use App\Helpers\ConfigHelper;
use Laravel\Telescope\Http\Middleware\Authorize;
class TelescopeAuthorize extends Authorize
{
/**
* @inheritDoc
*/
public function handle($request, $next)
{
return $this->check($request) ? $next($request) : abort(403);
}
/**
* @param $request
* @return bool
*/
public function check($request): bool
{
return app()->environment('local') || in_array($request->ip(), ConfigHelper::getTelescopeIpList(), true);
}
}