File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,18 @@ public function update(Request $request): RedirectResponse
6363 ->secretSantaParticipant ()
6464 ->firstOrNew ();
6565
66+ if (!$ participant ->exists ) {
67+ Toast::warning ('К сожалению, регистрация на Тайного Санту уже закрыта. ' )
68+ ->disableAutoHide ();
69+
70+ return redirect ()->route ('santa ' );
71+ }
72+
6673 $ data = $ request ->validate ([
67- 'telegram ' => ['string ' , 'required_without:tracking_number ' ],
68- 'phone ' => ['string ' , 'required_without:tracking_number ' ],
69- 'address ' => ['string ' , 'required_without:tracking_number ' ],
70- 'about ' => ['string ' , 'required_without:tracking_number ' ],
74+ // 'telegram' => ['string', 'required_without:tracking_number'],
75+ // 'phone' => ['string', 'required_without:tracking_number'],
76+ // 'address' => ['string', 'required_without:tracking_number'],
77+ // 'about' => ['string', 'required_without:tracking_number'],
7178 'tracking_number ' => [
7279 'nullable ' ,
7380 'string ' ,
Original file line number Diff line number Diff line change 1616 </x-slot >
1717
1818 <x-slot:actions >
19- <a href =" {{ route (' santa.game' ) } }" class =" btn btn-primary btn-lg px-4" >{{ $participant -> exists ? ' Посмотреть статус' : ' Присоединиться' } } </a >
19+
20+ @if ($participant -> exists )
21+ <a href =" {{ route (' santa.game' ) } }" class =" btn btn-primary btn-lg px-4" >
22+ Посмотреть статус
23+ </a >
24+ @else
25+ <a href =" {{ route (' santa.game' ) } }" class =" btn btn-primary btn-lg px-4 disabled pe-none" disabled >
26+ Санта уже укомплектован 🎅
27+ {{-- Присоединиться --}}
28+ </a >
29+ @endif
30+
31+
2032 <a href =" {{ route (' santa.rules' ) } }" class =" d-none d-md-inline-flex link-body-emphasis text-decoration-none icon-link icon-link-hover" >
2133 Полные правила
2234 <x-icon path =" i.arrow-right" class =" bi" />
You can’t perform that action at this time.
0 commit comments