public function getNonParticipants() { if (!$this->event_unique_link) { throw new Exception("No event unique link here"); } return \PlayFooty\Participant::where('event_unique_link', $this->event_unique_link)->where('playing', 0)->get(); }
public function optOut(Request $request, \PlayFooty\Event $event, $participantId) { $participant = \PlayFooty\Participant::where('event_unique_link', $event->event_unique_link)->where('id', $participantId)->firstOrFail(); $request->session()->flash('flashMessage', $participant->name . ' sent off!'); Event::fire(new ParticipantOptOutEvent($event, $participant)); $participant->delete(); return back(); }