public function postDelete() { try { $File = File::find(\Input::get('id')); $File->destroy($File->id); Folder_File_Attached::where('file_id', $File->id)->delete(); $myFile = new MyFile(); $myFile->FileDelete($this->upload_path . $File->year . '/' . $File->month . '/', $File->name); } catch (exception $ex) { return \Response::json($ex->getMessage()); } return \Response::json('deleted'); }
public function FolderList($path) { $folders = \File::directories($path); $i = 0; $result = []; foreach ($folders as $folder) { $data = self::dirSize($folder); $result[$i++ . '_filecount'] = $data['count']; $result[$i . '_filessize'] = $data['size']; } return $result; }