public function run() { DB::table('availability_page')->delete(); $success = File::cleanDirectory($this->getImagesPath()); File::put($this->getImagesPath() . '.gitignore', File::get(public_path() . '/../app/storage/cache/.gitignore')); AvailabilityPage::create(['image_name' => ""]); }
public function getAvailability() { $objects = Object::where('shown', '=', 1)->get(); $availabilityPage = AvailabilityPage::first(); return View::make('site.availability', array('objects' => $objects, 'availabilityPage' => $availabilityPage)); }
public function deleteAvailabilityPageImage() { $availabilityPage = AvailabilityPage::first(); $path = AvailabilityPage::IMAGES_FOLDER . $availabilityPage->image_name; $availabilityPage->update(array('image_name' => '')); $this->deleteImageFromFileSystem($path); }