/** * Get list of folders as json to populate treeview * * @return mixed */ public function getFolders() { $user_path = parent::getPath('user'); $lfm_user_path = parent::getFileName($user_path); $user_folders = parent::getDirectories($user_path); $share_path = parent::getPath('share'); $lfm_share_path = parent::getFileName($share_path); $shared_folders = parent::getDirectories($share_path); return view('laravel-filemanager::tree')->with('user_dir', $lfm_user_path['long'])->with('dirs', $user_folders)->with('share_dir', $lfm_share_path['long'])->with('shares', $shared_folders); }
/** * Get the images to load for a selected folder * * @return mixed */ public function getItems() { $type = Input::get('type'); $view = $this->getView(); $path = parent::getPath(); $files = File::files($path); $file_info = $this->getFileInfos($files, $type); $directories = parent::getDirectories($path); $thumb_url = parent::getUrl('thumb'); return view($view)->with(compact('type', 'file_info', 'directories', 'thumb_url')); }