$args */ public function __invoke(null $_, array $args): array { $this->runHttpMiddleware([ EnabledOnlyOnLocalhost::class, EnsureFeaturesAreActive::using(AllowExternalProfileManagement::class), ]); $profile = ExternalProfile::query()->find(Arr::pull($args, 'id')); throw_unless( $profile->canBeSynced(), AuthorizationException::class, 'This external profile cannot be synced at the moment.' ); $profile->dispatchSyncJob(); return [ 'message' => 'Job dispatched.', ]; } }