/** * Delete a File from the database and storage. * @param Attachment $attachment */ public function deleteFile(Attachment $attachment) { if ($attachment->external) { $attachment->delete(); return; } $this->deleteFileInStorage($attachment); $attachment->delete(); }