'required|integer|exists:accounts,id', 'document_id' => 'required|integer', ]; } /** * Destroy a document. * * @param array $data * @return bool */ public function execute(array $data): bool { $this->validate($data); $document = Document::where('account_id', $data['account_id']) ->findOrFail($data['document_id']); // Delete the physical document // Throws FileNotFoundException Storage::delete($document->new_filename); // Delete the object in the DB $document->delete(); return true; } }