/** * Deletes photos * * @return mixed */ public function delete() { $imageUrl = $this->image; if (unlink($imageUrl)) { return parent::delete(); } }
/** * Deletes customers * * @return mixed */ public function delete() { foreach ($this->photos()->get() as $photo) { $photo->delete(); } return parent::delete(); }