tokenData['scope']; $scopes = explode(' ', $scopes); if (! in_array('create', $scopes, true)) { throw new InvalidTokenScopeException; } $location = resolve(PlaceService::class)->createPlace($data->toArray())->uri; return [ 'response' => 'created', 'url' => $location, ]; } }