'required|integer|exists:accounts,id', 'conversation_id' => 'required|integer|exists:conversations,id', ]; } /** * Destroy a conversation. * * @param array $data * @return bool */ public function execute(array $data): bool { $this->validate($data); $conversation = Conversation::where('account_id', $data['account_id']) ->findOrFail($data['conversation_id']); $conversation->contact->throwInactive(); $conversation->delete(); return true; } }