append(':') ->append(AllowExternalProfileManagement::class) ->__toString(); $this->middleware(EnabledOnlyOnLocalhost::class); $this->middleware($isExternalProfileManagementAllowed)->except(['show']); } /** * Display the current progress status of the sync. * * @param ShowRequest $request * @param ExternalProfile $externalprofile */ public function show(ShowRequest $request, ExternalProfile $externalprofile) { // TODO } /** * Start a new sync job. * * @param ExternalProfile $externalProfile * @return JsonResponse */ public function store(ExternalProfile $externalProfile) { if (!$externalProfile->canBeSynced()) { return new JsonResponse([ 'error' => 'This external profile cannot be synced at the moment.' ], 403); } $externalProfile->startSyncJob(); return new JsonResponse([ 'message' => 'Job dispatched.' ], 201); } }