diff --git a/app/Http/Controllers/Api/PhotoboothConnectController.php b/app/Http/Controllers/Api/PhotoboothConnectController.php index d1c9ddf..678601f 100644 --- a/app/Http/Controllers/Api/PhotoboothConnectController.php +++ b/app/Http/Controllers/Api/PhotoboothConnectController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api; use App\Http\Controllers\Controller; use App\Http\Requests\Photobooth\PhotoboothConnectRedeemRequest; +use App\Models\Event; use App\Services\Photobooth\PhotoboothConnectCodeService; use Illuminate\Http\JsonResponse; @@ -33,6 +34,7 @@ class PhotoboothConnectController extends Controller return response()->json([ 'data' => [ + 'event_name' => $this->resolveEventName($event), 'upload_url' => route('api.v1.photobooth.upload'), 'username' => $setting->username, 'password' => $setting->password, @@ -42,4 +44,27 @@ class PhotoboothConnectController extends Controller ], ]); } + + private function resolveEventName(?Event $event): ?string + { + if (! $event) { + return null; + } + + $name = $event->name; + + if (is_string($name) && trim($name) !== '') { + return $name; + } + + if (is_array($name)) { + foreach ($name as $value) { + if (is_string($value) && trim($value) !== '') { + return $value; + } + } + } + + return $event->slug ?: null; + } } diff --git a/clients/photobooth-uploader/PhotoboothUploader/Assets/sample-upload.png b/clients/photobooth-uploader/PhotoboothUploader/Assets/sample-upload.png new file mode 100644 index 0000000..fef1915 Binary files /dev/null and b/clients/photobooth-uploader/PhotoboothUploader/Assets/sample-upload.png differ diff --git a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml index a52b0a1..2088699 100644 --- a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml +++ b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml @@ -30,6 +30,7 @@