public function delete($id) { return Property::destroy($id); // $delSuccess = Property::destroy($id); // if ($delSuccess) { // $images[] = Image::where('propertyId', $id)->get(); // //unlink the image. // foreach ($images as $key => $filename) { // $imagePath = base_path() .'/public/uploads/' . $filename[0]->filename; // if (file_exists($imagePath)) { // unlink($imagePath); // } // } // } }
public static function delete($id) { Property::destroy($id); }