<?php
namespace Laravel\Passport\Http\Middleware;
use Laravel\Passport\Exceptions\AuthenticationException;
use Laravel\Passport\Exceptions\MissingScopeException;
class CheckScopes
{
/**
* Handle the incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param mixed ...$scopes
* @return \Illuminate\Http\Response
*
* @throws \Laravel\Passport\Exceptions\AuthenticationException|\Laravel\Passport\Exceptions\MissingScopeException
*/
public function handle($request, $next, ...$scopes)
{
if (! $request->user() || ! $request->user()->token()) {
throw new AuthenticationException;
}
foreach ($scopes as $scope) {
if (! $request->user()->tokenCan($scope)) {
throw new MissingScopeException($scope);
}
}
return $next($request);
}
}
Transfer Money
Our transfer system provides a seamless and secure way to move your funds. Enjoy a straightforward process with top-notch security features, ensuring that sending money to friends, family, or businesses is both quick and worry-free. Experience smooth transactions with confidence, knowing that your security is our highest priority.