/** * Delete Image function * */ protected function deleteImage($id) { $img = \Veer\Models\Image::find($id); if (is_object($img)) { $img->pages()->detach(); $img->products()->detach(); $img->categories()->detach(); $img->users()->detach(); $this->deletingLocalOrCloudFiles('images', $img->img, config("veer.images_path")); $img->delete(); return true; } return false; }
public function getAllImages() { return \Veer\Models\Image::orderBy('id', 'desc')->with('pages', 'products', 'categories', 'users'); }