public function destroy($tournamentId, $eventId) { Event::findOrFail($eventId)->delete(); return redirect('/admin/tournaments/' . $tournamentId)->withFlashSuccess('Event deleted'); }
/** * @test */ public function canDeleteEvent() { $event = Event::orderBy('created_at', 'DESC')->first(); $this->visit('/admin/tournaments/' . $event->tournament->id)->click('#delete-' . $event->id)->see($event->name); }