'required|integer|exists:accounts,id', 'reminder_id' => 'required|integer|exists:reminders,id', ]; } /** * Destroy a reminder and all scheduled reminders that are associated with * it (in ReminderOutbox table) thanks to foreign keys. * * @param array $data * @return bool */ public function execute(array $data): bool { $this->validate($data); $reminder = Reminder::where('account_id', $data['account_id']) ->findOrFail($data['reminder_id']); $reminder->contact->throwInactive(); $reminder->delete(); return true; } }