diff --git a/app/Orchid/Screens/SecretSantaScreen.php b/app/Orchid/Screens/SecretSantaScreen.php index 437a3a77..60523f2f 100644 --- a/app/Orchid/Screens/SecretSantaScreen.php +++ b/app/Orchid/Screens/SecretSantaScreen.php @@ -5,7 +5,6 @@ use App\Models\SecretSantaParticipant; use App\Models\User; use Illuminate\Http\Request; -use Illuminate\Validation\Rule; use Orchid\Screen\Actions\Link; use Orchid\Screen\Actions\ModalToggle; use Orchid\Screen\Components\Cells\DateTimeSplit; @@ -72,10 +71,10 @@ public function layout(): array Select::make('participant.status') ->title('Статус участника') ->options([ - 'new' => 'Новый', - 'pending' => 'Ожидает', + 'new' => 'Новый', + 'pending' => 'Ожидает', 'in_progress' => 'В процессе', - 'done' => 'Завершён', + 'done' => 'Завершён', ]) ->empty('Выберите статус') ->help('Укажите текущий статус участия.'), @@ -83,18 +82,17 @@ public function layout(): array ->method('update') ->deferred('loadParticipant'), - Layout::table('participants', [ TD::make('user.name', 'Пользователь (Санта)') - ->render(fn(SecretSantaParticipant $participant) => ModalToggle::make($participant->user->name) + ->render(fn (SecretSantaParticipant $participant) => ModalToggle::make($participant->user->name) ->modalTitle($participant->user->name) ->modal('edit-participant', [ - 'participant' => $participant + 'participant' => $participant, ]) ), TD::make('receiver', 'Получатель') - ->render(fn(SecretSantaParticipant $participant) => $participant->receiver?->user->name ?? 'Не назначен' + ->render(fn (SecretSantaParticipant $participant) => $participant->receiver?->user->name ?? 'Не назначен' ), /* @@ -107,7 +105,7 @@ public function layout(): array ->width(200), TD::make('receiver.telegram', 'Telegram') - ->render(fn(SecretSantaParticipant $participant) => $participant->receiver?->telegram + ->render(fn (SecretSantaParticipant $participant) => $participant->receiver?->telegram ? Link::make($participant->receiver?->telegram)->href("https://t.me/{$participant->receiver?->telegram}") : '—' ), @@ -117,7 +115,7 @@ public function layout(): array TD::make('receiver.phone', 'Номер телефона'), TD::make('status', 'Статус') - ->render(fn(SecretSantaParticipant $participant) => $participant->status === 'done' + ->render(fn (SecretSantaParticipant $participant) => $participant->status === 'done' ? '✅ Завершён' : '⏳ Ожидает' ), @@ -133,20 +131,20 @@ public function layout(): array /** * @param SecretSantaParticipant $participant + * * @return SecretSantaParticipant[] */ public function loadParticipant(SecretSantaParticipant $participant) { return [ - 'participant' => $participant + 'participant' => $participant, ]; } - public function update(Request $request, SecretSantaParticipant $participant): void { $participant->fill($request->input('participant'))->save(); - Toast::info("Информация обновлена"); + Toast::info('Информация обновлена'); } }