├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app ├── Commands │ └── Command.php ├── Console │ ├── Commands │ │ └── Inspire.php │ └── Kernel.php ├── Events │ └── Event.php ├── Exceptions │ └── Handler.php ├── FileManager │ ├── AbstractObject.php │ ├── Directory │ │ ├── Directory.php │ │ └── DirectoryPresenter.php │ ├── File │ │ ├── File.php │ │ └── FilePresenter.php │ ├── FileManager.php │ └── FileManagerPresenter.php ├── Handlers │ ├── Commands │ │ └── .gitkeep │ └── Events │ │ └── .gitkeep ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── AuthController.php │ │ │ └── PasswordController.php │ │ ├── Controller.php │ │ └── HomeController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── RedirectIfAuthenticated.php │ │ └── VerifyCsrfToken.php │ ├── Requests │ │ ├── CreateDirectoryRequest.php │ │ ├── DeleteObjectRequest.php │ │ ├── MoveObjectRequest.php │ │ ├── Request.php │ │ └── UploadFileRequest.php │ └── routes.php ├── Providers │ ├── AppServiceProvider.php │ ├── BusServiceProvider.php │ ├── ConfigServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Services │ ├── MetaInfoService.php │ └── Registrar.php └── User.php ├── artisan ├── bootstrap ├── app.php └── autoload.php ├── bower.json ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── cache.php ├── compile.php ├── database.php ├── filesystems.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── migrations │ ├── .gitkeep │ ├── 2014_10_12_000000_create_users_table.php │ └── 2014_10_12_100000_create_password_resets_table.php └── seeds │ ├── .gitkeep │ └── DatabaseSeeder.php ├── gulpfile.js ├── package.json ├── phpspec.yml ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── images │ ├── .gitkeep │ ├── directory.png │ └── file.png ├── index.php └── robots.txt ├── resources ├── assets │ ├── coffee │ │ └── app.coffee │ └── less │ │ ├── app.less │ │ └── bootstrap │ │ ├── alerts.less │ │ ├── badges.less │ │ ├── bootstrap.less │ │ ├── breadcrumbs.less │ │ ├── button-groups.less │ │ ├── buttons.less │ │ ├── carousel.less │ │ ├── close.less │ │ ├── code.less │ │ ├── component-animations.less │ │ ├── dropdowns.less │ │ ├── forms.less │ │ ├── glyphicons.less │ │ ├── grid.less │ │ ├── input-groups.less │ │ ├── jumbotron.less │ │ ├── labels.less │ │ ├── list-group.less │ │ ├── media.less │ │ ├── mixins.less │ │ ├── mixins │ │ ├── alerts.less │ │ ├── background-variant.less │ │ ├── border-radius.less │ │ ├── buttons.less │ │ ├── center-block.less │ │ ├── clearfix.less │ │ ├── forms.less │ │ ├── gradients.less │ │ ├── grid-framework.less │ │ ├── grid.less │ │ ├── hide-text.less │ │ ├── image.less │ │ ├── labels.less │ │ ├── list-group.less │ │ ├── nav-divider.less │ │ ├── nav-vertical-align.less │ │ ├── opacity.less │ │ ├── pagination.less │ │ ├── panels.less │ │ ├── progress-bar.less │ │ ├── reset-filter.less │ │ ├── resize.less │ │ ├── responsive-visibility.less │ │ ├── size.less │ │ ├── tab-focus.less │ │ ├── table-row.less │ │ ├── text-emphasis.less │ │ ├── text-overflow.less │ │ └── vendor-prefixes.less │ │ ├── modals.less │ │ ├── navbar.less │ │ ├── navs.less │ │ ├── normalize.less │ │ ├── pager.less │ │ ├── pagination.less │ │ ├── panels.less │ │ ├── popovers.less │ │ ├── print.less │ │ ├── progress-bars.less │ │ ├── responsive-embed.less │ │ ├── responsive-utilities.less │ │ ├── scaffolding.less │ │ ├── tables.less │ │ ├── theme.less │ │ ├── thumbnails.less │ │ ├── tooltip.less │ │ ├── type.less │ │ ├── utilities.less │ │ ├── variables.less │ │ └── wells.less ├── lang │ └── en │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── app.blade.php │ ├── auth │ ├── login.blade.php │ ├── password.blade.php │ ├── register.blade.php │ └── reset.blade.php │ ├── emails │ └── password.blade.php │ ├── errors │ └── 503.blade.php │ ├── home.blade.php │ └── vendor │ └── .gitkeep ├── server.php ├── storage ├── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore └── tests ├── ExampleTest.php └── TestCase.php /.env.example: -------------------------------------------------------------------------------- 1 | DISK_NAME=local 2 | DISK_DRIVER=local 3 | DISK_ROOT=/var/disk 4 | 5 | APP_ENV=local 6 | APP_DEBUG=true 7 | APP_KEY=SomeRandomString 8 | 9 | DB_HOST=localhost 10 | DB_DATABASE=homestead 11 | DB_USERNAME=homestead 12 | DB_PASSWORD=secret 13 | 14 | CACHE_DRIVER=file 15 | SESSION_DRIVER=file 16 | QUEUE_DRIVER=sync 17 | 18 | MAIL_DRIVER=smtp 19 | MAIL_HOST=mailtrap.io 20 | MAIL_PORT=2525 21 | MAIL_USERNAME=null 22 | MAIL_PASSWORD=null 23 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.less linguist-vendored 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /node_modules 3 | /bower_components 4 | /.idea 5 | .env 6 | .DS_Store 7 | /public/js 8 | /public/css 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FileManager 2 | 3 | FileManager是一个基于PHP Laravel的Web文件管理器,支持基础文件操作。 4 | ![image](https://s3-us-west-2.amazonaws.com/assets.cdn.univerch.com/filemanager.png) 5 | 6 | ## 服务器要求 7 | 8 | * PHP >= 5.4 9 | * composer 10 | * npm 11 | 12 | ## 基础功能 13 | 14 | * 基础用户验证 15 | * 自定义文件系统物理路径 16 | * 文件(夹)创建、上传、下载、重命名、删除 17 | * AJAX支持 18 | 19 | ## 在线演示 20 | 21 | * 测试地址(暂时下线) 22 | * 测试用户:test@test.local 23 | * 密码:123456 24 | 25 | ## 安装 26 | 27 | 1. 克隆Git仓库 28 | 29 | ``` 30 | git clone https://github.com/lzhang43/FileManager.git 31 | ``` 32 | 33 | 2. 安装依赖库 34 | 35 | ``` 36 | composer install 37 | npm install 38 | ``` 39 | 40 | 3. 编译CSS、JS文件 41 | 42 | ``` 43 | gulp 44 | ``` 45 | 46 | ## 配置 47 | 48 | 1. 在程序根目录下,复制环境变量配置文件 49 | 50 | ``` 51 | cp .env.example .env 52 | ``` 53 | 54 | 2. 修改环境变量 55 | 56 | ``` 57 | DISK_NAME=local // 默认“磁盘”名称为local 58 | DISK_DRIVER=local // 默认使用本地文件系统,也通过Laravel支持 Amazon S3 和 RackSpace 59 | DISK_ROOT=/var/disk // 可自定义“磁盘”根目录,默认情况下使用程序目录下 storage/app 目录作为根目录 60 | 61 | DB_HOST=localhost // 数据库地址 62 | DB_DATABASE=homestead // 数据库名称 63 | DB_USERNAME=hoemstead // 数据库用户名 64 | DB_PASSWORD=secret // 数据库密码 65 | ``` 66 | 67 | 3. 安装数据库 68 | 69 | ``` 70 | php artisan migrate 71 | ``` 72 | 73 | 4. 安装完毕后即可通过Web浏览器访问使用 74 | -------------------------------------------------------------------------------- /app/Commands/Command.php: -------------------------------------------------------------------------------- 1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 26 | ->hourly(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/Events/Event.php: -------------------------------------------------------------------------------- 1 | $dirPath, 42 | 'pathinfo' => $this->getPathInfo($dirPath), 43 | 'mime' => $this->getMimeType($dirPath), 44 | 'type' => 'directory', 45 | 'lastModified' => $this->getLastModified($dirPath) 46 | ]); 47 | } 48 | 49 | public function getAllWithMeta($path, $sortBy = "path") 50 | { 51 | $names = $this->getAll($path); 52 | $directories = new Collection(); 53 | 54 | foreach ($names as $name) 55 | { 56 | $directories->add($this->getObjectMeta($name)); 57 | } 58 | 59 | return $directories->sortBy($sortBy); 60 | } 61 | 62 | public function createDir($dirPath) 63 | { 64 | return Storage::makeDirectory(trim($dirPath)); 65 | } 66 | 67 | public function deleteObject($dirPath) 68 | { 69 | return Storage::deleteDirectory($dirPath); 70 | } 71 | 72 | /** 73 | * @return string The path to the presenter class 74 | */ 75 | public function getPresenterClass() 76 | { 77 | return DirectoryPresenter::class; 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /app/FileManager/Directory/DirectoryPresenter.php: -------------------------------------------------------------------------------- 1 | wrappedObject = $resource; 11 | } 12 | 13 | public function lastModified() 14 | { 15 | $lastModified = $this->wrappedObject->lastModified; 16 | 17 | return Carbon::createFromTimeStamp($lastModified)->diffForHumans(); 18 | } 19 | 20 | public function url() 21 | { 22 | return action('HomeController@index', [$this->path]); 23 | } 24 | 25 | public function basename() 26 | { 27 | $basename = $this->wrappedObject->pathinfo['basename']; 28 | 29 | if (strlen($basename) > 20) 30 | { 31 | return mb_substr($basename, 0, 19) . "..."; 32 | } 33 | 34 | return $basename; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/FileManager/File/File.php: -------------------------------------------------------------------------------- 1 | exists($filePath); 28 | } 29 | 30 | public function getFile($filePath) 31 | { 32 | return Storage::get($filePath); 33 | } 34 | 35 | public function getAll($dirPath) 36 | { 37 | return Storage::Files($dirPath); 38 | } 39 | 40 | public function getFileSize($filePath) 41 | { 42 | return Storage::size($filePath); 43 | } 44 | 45 | public function getLastModified($filePath) 46 | { 47 | return Storage::lastModified($filePath); 48 | } 49 | 50 | public function getMimetype($filePath) 51 | { 52 | return Storage::Mimetype($filePath); 53 | } 54 | 55 | public function getObjectMeta($filePath) 56 | { 57 | return new File(['path' => $filePath, 58 | 'pathinfo' => $this->getPathInfo($filePath), 59 | 'type' => 'file', 60 | 'mime' => $this->getMimetype($filePath), 61 | 'fileSize' => $this->getFileSize($filePath), 62 | 'lastModified' => $this->getLastModified($filePath) 63 | ]); 64 | } 65 | 66 | public function moveObject($oldPath, $newPath) 67 | { 68 | return Storage::move($oldPath, $newPath); 69 | } 70 | 71 | public function deleteObject($path) 72 | { 73 | return Storage::delete($path); 74 | } 75 | 76 | public function getAllWithMeta($path, $sortBy = "path") 77 | { 78 | $names = $this->getAll($path); 79 | $files = new Collection(); 80 | 81 | foreach ($names as $name) 82 | { 83 | $files->add($this->getObjectMeta($name)); 84 | } 85 | 86 | return $files->sortBy($sortBy); 87 | } 88 | 89 | public function uploadFile($filePath, $fileContent) 90 | { 91 | return Storage::disk(env('DISK_NAME', 'local'))->put(trim($filePath), $fileContent); 92 | } 93 | 94 | /** 95 | * @return string The path to the presenter class 96 | */ 97 | public function getPresenterClass() 98 | { 99 | return FilePresenter::class; 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /app/FileManager/File/FilePresenter.php: -------------------------------------------------------------------------------- 1 | wrappedObject = $resource; 11 | } 12 | 13 | public function basename() 14 | { 15 | $basename = $this->wrappedObject->pathinfo['basename']; 16 | 17 | if (strlen($basename) > 40) 18 | { 19 | return mb_substr($basename, 0, 30) . "..."; 20 | } 21 | 22 | return $basename; 23 | } 24 | 25 | public function lastModified() 26 | { 27 | $lastModified = $this->wrappedObject->lastModified; 28 | 29 | return Carbon::createFromTimeStamp($lastModified)->diffForHumans(); 30 | } 31 | 32 | public function url() 33 | { 34 | return action('HomeController@index', [$this->path]); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/FileManager/FileManager.php: -------------------------------------------------------------------------------- 1 | file = $file; 13 | $this->directory = $directory; 14 | } 15 | 16 | /** 17 | * The attributes excluded from the model's JSON form. 18 | * 19 | * @var array 20 | */ 21 | protected $hidden = []; 22 | 23 | protected $casts = []; 24 | 25 | /** 26 | * @return string The path to the presenter class 27 | */ 28 | public function getPresenterClass() 29 | { 30 | return FileManagerPresenter::class; 31 | } 32 | 33 | public function getAllWithMeta($path) 34 | { 35 | $objects = $this->directory->getAllWithMeta($path); 36 | $files = $this->file->getAllWithMeta($path); 37 | 38 | foreach($files as $file) { 39 | $objects->add($file); 40 | } 41 | 42 | return $objects; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /app/FileManager/FileManagerPresenter.php: -------------------------------------------------------------------------------- 1 | wrappedObject = $resource; 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /app/Handlers/Commands/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/app/Handlers/Commands/.gitkeep -------------------------------------------------------------------------------- /app/Handlers/Events/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/app/Handlers/Events/.gitkeep -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthController.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 33 | $this->registrar = $registrar; 34 | 35 | $this->middleware('guest', ['except' => 'getLogout']); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordController.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 33 | $this->passwords = $passwords; 34 | 35 | $this->middleware('guest'); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 36 | $this->fileManager = $fileManager; 37 | $this->file = $file; 38 | $this->directory = $directory; 39 | } 40 | 41 | public function create(CreateDirectoryRequest $request) // Inject validator 42 | { 43 | $data = $request->only('path', 'dirName'); // Retrieve inputs 44 | 45 | if ($data['path'] == '/') 46 | { 47 | $dirPath = "/" . $data['dirName']; 48 | } 49 | else 50 | { 51 | $dirPath = $data['path'] . "/" . $data['dirName']; 52 | } 53 | 54 | // Check if the directory already exist 55 | while ($this->file->isFileExsit($dirPath)) 56 | { 57 | $dirPath .= " (2)"; 58 | trim($dirPath); 59 | } 60 | 61 | if (! $this->directory->createDir($dirPath)) 62 | { 63 | // Throw an unknown error 64 | } 65 | 66 | return response()->json($this->directory->getObjectMeta($dirPath)); 67 | } 68 | 69 | public function upload(UploadFileRequest $request) // Inject validator 70 | { 71 | $data = $request->only('dirPath'); // Retrieve meta data 72 | $files = $request->file('files'); // Retrieve the files 73 | 74 | // Check if the directory exist 75 | if ($this->file->isFileExsit($data['dirPath'])) 76 | { 77 | // Throw exception 78 | } 79 | 80 | $errors = []; // Initialize message bag 81 | $success = []; 82 | foreach ($files as $key => $file) 83 | { 84 | // Construct physical path to the file 85 | $fileName = MetaInfoService::mb_pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME); 86 | $fileExtension = "." . $file->getClientOriginalExtension(); 87 | 88 | if ($data['dirPath'] == '/') 89 | { 90 | $filePath = "/" . $fileName; 91 | } 92 | else 93 | { 94 | $filePath = $data['dirPath'] . "/" . $fileName; 95 | } 96 | 97 | // Determine if the file already exist 98 | while ($this->file->isFileExsit($filePath . $fileExtension)) 99 | { 100 | $filePath .= " (2)"; 101 | } 102 | 103 | if ($fileExtension !== ".") 104 | { 105 | $filePath .= $fileExtension; // Full file path 106 | } 107 | 108 | $fileContent = FileService::get($file); 109 | 110 | // Upload the file 111 | if (!$this->file->uploadFile(trim($filePath), $fileContent)) 112 | { 113 | $errors[] = array( "fileName" => $fileName ); 114 | } 115 | 116 | $success[] = $this->file->getObjectMeta($filePath); 117 | } 118 | 119 | return response()->json(array("errors" => $errors, "success" => $success)); 120 | } 121 | 122 | public function move(MoveObjectRequest $request) 123 | { 124 | // Retrieve inputs 125 | $data = $request->only('path', 'oldName', 'newName', 'fileType'); 126 | 127 | $this->file->moveObject($data['path'] . '/' . $data['oldName'], $data['path'] . '/' . $data['newName']); 128 | 129 | if($data['fileType'] == 'directory') 130 | { 131 | return response()->json($this->directory->getObjectMeta($data['path'] . '/' . $data['newName'])); 132 | } 133 | 134 | return response()->json($this->file->getObjectMeta($data['path'] . '/' . $data['newName'])); 135 | } 136 | 137 | public function delete(DeleteObjectRequest $request) 138 | { 139 | // Retrieve inputs 140 | $data = $request->only('path', 'fileType'); 141 | 142 | if ($data['fileType'] == 'directory') 143 | { 144 | return response()->json($this->directory->deleteObject($data['path'])); 145 | } 146 | 147 | return response()->json($this->file->deleteObject($data['path'])); 148 | } 149 | 150 | /** 151 | * Main entrance. 152 | * 153 | * @return Response 154 | */ 155 | public function index($path = '/') 156 | { 157 | if (! $this->file->isFileExsit($path)) 158 | { 159 | abort(404); 160 | } 161 | 162 | if ($this->file->getMimetype($path) !== "directory") 163 | { 164 | $fileName = $this->file->getPathInfo($path)['basename']; 165 | $fileContent = $this->file->getFile($path); 166 | 167 | return response ($fileContent, 200) 168 | ->header("Content-Type", "application/octet-stream") 169 | ->header("Content-Disposition", 'attachment; filename=' . $fileName); 170 | } 171 | 172 | $objects = $this->fileManager->getAllWithMeta($path); 173 | 174 | $maxFileSize = MetaInfoService::max_file_size(False); 175 | $maxFileSizeBytes = MetaInfoService::max_file_size(True); 176 | 177 | return view('home', compact('path', 'objects', 'maxFileSize', 'maxFileSizeBytes')); 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 'App\Http\Middleware\Authenticate', 28 | 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth', 29 | 'guest' => 'App\Http\Middleware\RedirectIfAuthenticated', 30 | ]; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 24 | } 25 | 26 | /** 27 | * Handle an incoming request. 28 | * 29 | * @param \Illuminate\Http\Request $request 30 | * @param \Closure $next 31 | * @return mixed 32 | */ 33 | public function handle($request, Closure $next) 34 | { 35 | if ($this->auth->guest()) 36 | { 37 | if ($request->ajax()) 38 | { 39 | return response('Unauthorized.', 401); 40 | } 41 | else 42 | { 43 | return redirect()->guest('auth/login'); 44 | } 45 | } 46 | 47 | return $next($request); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 25 | } 26 | 27 | /** 28 | * Handle an incoming request. 29 | * 30 | * @param \Illuminate\Http\Request $request 31 | * @param \Closure $next 32 | * @return mixed 33 | */ 34 | public function handle($request, Closure $next) 35 | { 36 | if ($this->auth->check()) 37 | { 38 | return new RedirectResponse(url('/home')); 39 | } 40 | 41 | return $next($request); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 'required', # Validate file name 31 | 'dirName' => 'required' 32 | ]; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/Http/Requests/DeleteObjectRequest.php: -------------------------------------------------------------------------------- 1 | 'required' 31 | ]; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Requests/MoveObjectRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 31 | 'oldName' => 'required', 32 | 'newName' => 'required', 33 | 'fileType' => 'required' 34 | ]; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/Http/Requests/Request.php: -------------------------------------------------------------------------------- 1 | 'required', 31 | 'files' => 'required' 32 | ]; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/Http/routes.php: -------------------------------------------------------------------------------- 1 | where('path', '(.*)'); // List 20 | Route::put('manager/put/directory', 'HomeController@create'); // Create a new directory 21 | Route::put('manager/put/file', 'HomeController@upload'); // Upload a file 22 | Route::post('manager/move', 'HomeController@move'); // Move or rename an object 23 | Route::delete('manager/delete', 'HomeController@delete'); // Delete an object 24 | 25 | Route::controllers([ 26 | 'auth' => 'Auth\AuthController', 27 | 'password' => 'Auth\PasswordController', 28 | ]); 29 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind( 29 | 'Illuminate\Contracts\Auth\Registrar', 30 | 'App\Services\Registrar' 31 | ); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/Providers/BusServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapUsing(function($command) 17 | { 18 | return Dispatcher::simpleMapping( 19 | $command, 'App\Commands', 'App\Handlers\Commands' 20 | ); 21 | }); 22 | } 23 | 24 | /** 25 | * Register any application services. 26 | * 27 | * @return void 28 | */ 29 | public function register() 30 | { 31 | // 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/Providers/ConfigServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 15 | 'EventListener', 16 | ], 17 | ]; 18 | 19 | /** 20 | * Register any other events for your application. 21 | * 22 | * @param \Illuminate\Contracts\Events\Dispatcher $events 23 | * @return void 24 | */ 25 | public function boot(DispatcherContract $events) 26 | { 27 | parent::boot($events); 28 | 29 | // 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | group(['namespace' => $this->namespace], function($router) 39 | { 40 | require app_path('Http/routes.php'); 41 | }); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/Services/MetaInfoService.php: -------------------------------------------------------------------------------- 1 | '', 'basename' => '', 'extension' => '', 'filename' => ''); 14 | $m = array(); 15 | preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $m); 16 | if (array_key_exists(1, $m)) { 17 | $ret['dirname'] = $m[1]; 18 | } 19 | if (array_key_exists(2, $m)) { 20 | $ret['basename'] = $m[2]; 21 | } 22 | if (array_key_exists(5, $m)) { 23 | $ret['extension'] = $m[5]; 24 | } 25 | if (array_key_exists(3, $m)) { 26 | $ret['filename'] = $m[3]; 27 | } 28 | switch ($options) { 29 | case PATHINFO_DIRNAME: 30 | case 'dirname': 31 | return $ret['dirname']; 32 | break; 33 | case PATHINFO_BASENAME: 34 | case 'basename': 35 | return $ret['basename']; 36 | break; 37 | case PATHINFO_EXTENSION: 38 | case 'extension': 39 | return $ret['extension']; 40 | break; 41 | case PATHINFO_FILENAME: 42 | case 'filename': 43 | return $ret['filename']; 44 | break; 45 | default: 46 | return $ret; 47 | } 48 | } 49 | 50 | /** 51 | * Return max file size configuration 52 | * 53 | * @param bool $bytes 54 | * @return string | int 55 | */ 56 | static public function max_file_size($bytes = True) 57 | { 58 | if (! $bytes) 59 | { 60 | return ini_get('post_max_size'); 61 | } 62 | 63 | $val = trim(ini_get('post_max_size')); 64 | $last = strtolower($val[strlen($val)-1]); 65 | 66 | switch($last) { 67 | case 'g': 68 | $val *= 1024; 69 | case 'm': 70 | $val *= 1024; 71 | case 'k': 72 | $val *= 1024; 73 | default: 74 | $val; 75 | } 76 | 77 | return $val; 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /app/Services/Registrar.php: -------------------------------------------------------------------------------- 1 | 'required|max:255', 19 | 'email' => 'required|email|max:255|unique:users', 20 | 'password' => 'required|confirmed|min:6', 21 | ]); 22 | } 23 | 24 | /** 25 | * Create a new user instance after a valid registration. 26 | * 27 | * @param array $data 28 | * @return User 29 | */ 30 | public function create(array $data) 31 | { 32 | return User::create([ 33 | 'name' => $data['name'], 34 | 'email' => $data['email'], 35 | 'password' => bcrypt($data['password']), 36 | ]); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | make('Illuminate\Contracts\Console\Kernel'); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | 'Illuminate\Contracts\Http\Kernel', 31 | 'App\Http\Kernel' 32 | ); 33 | 34 | $app->singleton( 35 | 'Illuminate\Contracts\Console\Kernel', 36 | 'App\Console\Kernel' 37 | ); 38 | 39 | $app->singleton( 40 | 'Illuminate\Contracts\Debug\ExceptionHandler', 41 | 'App\Exceptions\Handler' 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | " 7 | ], 8 | "license": "MIT", 9 | "ignore": [ 10 | "**/.*", 11 | "node_modules", 12 | "bower_components", 13 | "test", 14 | "tests" 15 | ], 16 | "dependencies": { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "laravel/framework": "5.0.*", 9 | "illuminate/html": "5.0.*", 10 | "mccool/laravel-auto-presenter": "3.0.*", 11 | "jenssegers/model": "~1.0" 12 | }, 13 | "require-dev": { 14 | "phpunit/phpunit": "~4.0", 15 | "phpspec/phpspec": "~2.1" 16 | }, 17 | "autoload": { 18 | "classmap": [ 19 | "database" 20 | ], 21 | "psr-4": { 22 | "App\\": "app/" 23 | } 24 | }, 25 | "autoload-dev": { 26 | "classmap": [ 27 | "tests/TestCase.php" 28 | ] 29 | }, 30 | "scripts": { 31 | "post-install-cmd": [ 32 | "php artisan clear-compiled", 33 | "php artisan optimize" 34 | ], 35 | "post-update-cmd": [ 36 | "php artisan clear-compiled", 37 | "php artisan optimize" 38 | ], 39 | "post-create-project-cmd": [ 40 | "php -r \"copy('.env.example', '.env');\"", 41 | "php artisan key:generate" 42 | ] 43 | }, 44 | "config": { 45 | "preferred-install": "dist" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => 'App\User', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reset Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the options for resetting passwords including the view 52 | | that is your password reset e-mail. You can also set the name of the 53 | | table that maintains all of the reset tokens for your application. 54 | | 55 | | The expire time is the number of minutes that the reset token should be 56 | | considered valid. This security feature keeps tokens short-lived so 57 | | they have less time to be guessed. You may change this as needed. 58 | | 59 | */ 60 | 61 | 'password' => [ 62 | 'email' => 'emails.password', 63 | 'table' => 'password_resets', 64 | 'expire' => 60, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Cache Stores 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may define all of the cache "stores" for your application as 24 | | well as their drivers. You may even define multiple stores for the 25 | | same cache driver to group types of items stored in your caches. 26 | | 27 | */ 28 | 29 | 'stores' => [ 30 | 31 | 'apc' => [ 32 | 'driver' => 'apc' 33 | ], 34 | 35 | 'array' => [ 36 | 'driver' => 'array' 37 | ], 38 | 39 | 'database' => [ 40 | 'driver' => 'database', 41 | 'table' => 'cache', 42 | 'connection' => null, 43 | ], 44 | 45 | 'file' => [ 46 | 'driver' => 'file', 47 | 'path' => storage_path().'/framework/cache', 48 | ], 49 | 50 | 'memcached' => [ 51 | 'driver' => 'memcached', 52 | 'servers' => [ 53 | [ 54 | 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100 55 | ], 56 | ], 57 | ], 58 | 59 | 'redis' => [ 60 | 'driver' => 'redis', 61 | 'connection' => 'default', 62 | ], 63 | 64 | ], 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Cache Key Prefix 69 | |-------------------------------------------------------------------------- 70 | | 71 | | When utilizing a RAM based store such as APC or Memcached, there might 72 | | be other applications utilizing the same cache. So, we'll specify a 73 | | value to get prefixed to all our keys so we can avoid collisions. 74 | | 75 | */ 76 | 77 | 'prefix' => 'laravel', 78 | 79 | ]; 80 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | 18 | realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'), 19 | realpath(__DIR__.'/../app/Providers/BusServiceProvider.php'), 20 | realpath(__DIR__.'/../app/Providers/ConfigServiceProvider.php'), 21 | realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'), 22 | realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'), 23 | 24 | ], 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Compiled File Providers 29 | |-------------------------------------------------------------------------- 30 | | 31 | | Here you may list service providers which define a "compiles" function 32 | | that returns additional files that should be compiled, providing an 33 | | easy way to get common files from any packages you are utilizing. 34 | | 35 | */ 36 | 37 | 'providers' => [ 38 | // 39 | ], 40 | 41 | ]; 42 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_CLASS, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Database Connection Name 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may specify which of the database connections below you wish 24 | | to use as your default connection for all database work. Of course 25 | | you may use many connections at once using the Database library. 26 | | 27 | */ 28 | 29 | 'default' => 'mysql', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => [ 48 | 49 | 'sqlite' => [ 50 | 'driver' => 'sqlite', 51 | 'database' => storage_path().'/database.sqlite', 52 | 'prefix' => '', 53 | ], 54 | 55 | 'mysql' => [ 56 | 'driver' => 'mysql', 57 | 'host' => env('DB_HOST', 'localhost'), 58 | 'database' => env('DB_DATABASE', 'homestead'), 59 | 'username' => env('DB_USERNAME', 'homestead'), 60 | 'password' => env('DB_PASSWORD', 'secret'), 61 | 'charset' => 'utf8', 62 | 'collation' => 'utf8_unicode_ci', 63 | 'prefix' => env('DB_PREFIX', 'fm_'), 64 | 'strict' => false, 65 | ], 66 | 67 | 'pgsql' => [ 68 | 'driver' => 'pgsql', 69 | 'host' => env('DB_HOST', 'localhost'), 70 | 'database' => env('DB_DATABASE', 'forge'), 71 | 'username' => env('DB_USERNAME', 'forge'), 72 | 'password' => env('DB_PASSWORD', ''), 73 | 'charset' => 'utf8', 74 | 'prefix' => '', 75 | 'schema' => 'public', 76 | ], 77 | 78 | 'sqlsrv' => [ 79 | 'driver' => 'sqlsrv', 80 | 'host' => env('DB_HOST', 'localhost'), 81 | 'database' => env('DB_DATABASE', 'forge'), 82 | 'username' => env('DB_USERNAME', 'forge'), 83 | 'password' => env('DB_PASSWORD', ''), 84 | 'prefix' => '', 85 | ], 86 | 87 | ], 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | Migration Repository Table 92 | |-------------------------------------------------------------------------- 93 | | 94 | | This table keeps track of all the migrations that have already run for 95 | | your application. Using this information, we can determine which of 96 | | the migrations on disk haven't actually been run in the database. 97 | | 98 | */ 99 | 100 | 'migrations' => 'migrations', 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Redis Databases 105 | |-------------------------------------------------------------------------- 106 | | 107 | | Redis is an open source, fast, and advanced key-value store that also 108 | | provides a richer set of commands than a typical key-value systems 109 | | such as APC or Memcached. Laravel makes it easy to dig right in. 110 | | 111 | */ 112 | 113 | 'redis' => [ 114 | 115 | 'cluster' => false, 116 | 117 | 'default' => [ 118 | 'host' => '127.0.0.1', 119 | 'port' => 6379, 120 | 'database' => 0, 121 | ], 122 | 123 | ], 124 | 125 | ]; 126 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | 'local', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Default Cloud Filesystem Disk 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Many applications store files both locally and in the cloud. For this 26 | | reason, you may specify a default "cloud" driver here. This driver 27 | | will be bound as the Cloud disk implementation in the container. 28 | | 29 | */ 30 | 31 | 'cloud' => 's3', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Filesystem Disks 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here you may configure as many filesystem "disks" as you wish, and you 39 | | may even configure multiple disks of the same driver. Defaults have 40 | | been setup for each driver as an example of the required options. 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | env('DISK_NAME', 'local') => [ 47 | 'driver' => env('DISK_DRIVER', 'local'), 48 | 'root' => env('DISK_ROOT', storage_path().'/app'), 49 | ], 50 | 51 | 's3' => [ 52 | 'driver' => 's3', 53 | 'key' => 'your-key', 54 | 'secret' => 'your-secret', 55 | 'region' => 'your-region', 56 | 'bucket' => 'your-bucket', 57 | ], 58 | 59 | 'rackspace' => [ 60 | 'driver' => 'rackspace', 61 | 'username' => 'your-username', 62 | 'key' => 'your-key', 63 | 'container' => 'your-container', 64 | 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/', 65 | 'region' => 'IAD', 66 | 'url_type' => 'publicURL' 67 | ], 68 | 69 | ], 70 | 71 | ]; 72 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Mailgun mail service which will provide reliable deliveries. 28 | | 29 | */ 30 | 31 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to deliver e-mails to 39 | | users of the application. Like the host we have set this value to 40 | | stay compatible with the Mailgun e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => env('MAIL_PORT', 587), 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => ['address' => null, 'name' => null], 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | E-Mail Encryption Protocol 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the encryption protocol that should be used when 65 | | the application send e-mail messages. A sensible default using the 66 | | transport layer security protocol should provide great security. 67 | | 68 | */ 69 | 70 | 'encryption' => 'tls', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | SMTP Server Username 75 | |-------------------------------------------------------------------------- 76 | | 77 | | If your SMTP server requires a username for authentication, you should 78 | | set it here. This will get used to authenticate with your server on 79 | | connection. You may also set the "password" value below this one. 80 | | 81 | */ 82 | 83 | 'username' => env('MAIL_USERNAME'), 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | SMTP Server Password 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may set the password required by your SMTP server to send out 91 | | messages from your application. This will be given to the server on 92 | | connection so that the application will be able to send messages. 93 | | 94 | */ 95 | 96 | 'password' => env('MAIL_PASSWORD'), 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Sendmail System Path 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When using the "sendmail" driver to send e-mails, we will need to know 104 | | the path to where Sendmail lives on this server. A default path has 105 | | been provided here, which will work well on most of your systems. 106 | | 107 | */ 108 | 109 | 'sendmail' => '/usr/sbin/sendmail -bs', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Mail "Pretend" 114 | |-------------------------------------------------------------------------- 115 | | 116 | | When this option is enabled, e-mail will not actually be sent over the 117 | | web and will instead be written to your application's logs files so 118 | | you may inspect the message. This is great for local development. 119 | | 120 | */ 121 | 122 | 'pretend' => false, 123 | 124 | ]; 125 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Queue Connections 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may configure the connection information for each server that 27 | | is used by your application. A default configuration has been added 28 | | for each back-end shipped with Laravel. You are free to add more. 29 | | 30 | */ 31 | 32 | 'connections' => [ 33 | 34 | 'sync' => [ 35 | 'driver' => 'sync', 36 | ], 37 | 38 | 'database' => [ 39 | 'driver' => 'database', 40 | 'table' => 'jobs', 41 | 'queue' => 'default', 42 | 'expire' => 60, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'ttr' => 60, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => 'your-public-key', 55 | 'secret' => 'your-secret-key', 56 | 'queue' => 'your-queue-url', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'iron' => [ 61 | 'driver' => 'iron', 62 | 'host' => 'mq-aws-us-east-1.iron.io', 63 | 'token' => 'your-token', 64 | 'project' => 'your-project-id', 65 | 'queue' => 'your-queue-name', 66 | 'encrypt' => true, 67 | ], 68 | 69 | 'redis' => [ 70 | 'driver' => 'redis', 71 | 'queue' => 'default', 72 | 'expire' => 60, 73 | ], 74 | 75 | ], 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Failed Queue Jobs 80 | |-------------------------------------------------------------------------- 81 | | 82 | | These options configure the behavior of failed queue job logging so you 83 | | can control which database and table are used to store the jobs that 84 | | have failed. You may change them to any database / table you wish. 85 | | 86 | */ 87 | 88 | 'failed' => [ 89 | 'database' => 'mysql', 'table' => 'failed_jobs', 90 | ], 91 | 92 | ]; 93 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => '', 19 | 'secret' => '', 20 | ], 21 | 22 | 'mandrill' => [ 23 | 'secret' => '', 24 | ], 25 | 26 | 'ses' => [ 27 | 'key' => '', 28 | 'secret' => '', 29 | 'region' => 'us-east-1', 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => 'App\User', 34 | 'secret' => '', 35 | ], 36 | 37 | ]; 38 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session Encryption 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This option allows you to easily specify that all of your session data 42 | | should be encrypted before it is stored. All encryption will be run 43 | | automatically by Laravel and you can use the Session like normal. 44 | | 45 | */ 46 | 47 | 'encrypt' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session File Location 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the native session driver, we need a location where session 55 | | files may be stored. A default has been set for you but a different 56 | | location may be specified. This is only needed for file sessions. 57 | | 58 | */ 59 | 60 | 'files' => storage_path().'/framework/sessions', 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Connection 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" or "redis" session drivers, you may specify a 68 | | connection that should be used to manage these sessions. This should 69 | | correspond to a connection in your database configuration options. 70 | | 71 | */ 72 | 73 | 'connection' => null, 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Database Table 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When using the "database" session driver, you may specify the table we 81 | | should use to manage the sessions. Of course, a sensible default is 82 | | provided for you; however, you are free to change this as needed. 83 | | 84 | */ 85 | 86 | 'table' => 'sessions', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Sweeping Lottery 91 | |-------------------------------------------------------------------------- 92 | | 93 | | Some session drivers must manually sweep their storage location to get 94 | | rid of old sessions from storage. Here are the chances that it will 95 | | happen on a given request. By default, the odds are 2 out of 100. 96 | | 97 | */ 98 | 99 | 'lottery' => [2, 100], 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Cookie Name 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Here you may change the name of the cookie used to identify a session 107 | | instance by ID. The name specified here will get used every time a 108 | | new session cookie is created by the framework for every driver. 109 | | 110 | */ 111 | 112 | 'cookie' => 'laravel_session', 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Path 117 | |-------------------------------------------------------------------------- 118 | | 119 | | The session cookie path determines the path for which the cookie will 120 | | be regarded as available. Typically, this will be the root path of 121 | | your application but you are free to change this when necessary. 122 | | 123 | */ 124 | 125 | 'path' => '/', 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Session Cookie Domain 130 | |-------------------------------------------------------------------------- 131 | | 132 | | Here you may change the domain of the cookie used to identify a session 133 | | in your application. This will determine which domains the cookie is 134 | | available to in your application. A sensible default has been set. 135 | | 136 | */ 137 | 138 | 'domain' => null, 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | HTTPS Only Cookies 143 | |-------------------------------------------------------------------------- 144 | | 145 | | By setting this option to true, session cookies will only be sent back 146 | | to the server if the browser has a HTTPS connection. This will keep 147 | | the cookie from being sent to you if it can not be done securely. 148 | | 149 | */ 150 | 151 | 'secure' => false, 152 | 153 | ]; 154 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/views')) 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path().'/framework/views'), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/database/migrations/.gitkeep -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password', 60); 21 | $table->rememberToken(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('users'); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token')->index(); 19 | $table->timestamp('created_at'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('password_resets'); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/database/seeds/.gitkeep -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('UserTableSeeder'); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var elixir = require('laravel-elixir'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Elixir Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks 9 | | for your Laravel application. By default, we are compiling the Less 10 | | file for our application, as well as publishing vendor resources. 11 | | 12 | */ 13 | 14 | elixir(function(mix) { 15 | mix.less('app.less'); 16 | mix.coffee('app.coffee'); 17 | }); 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "devDependencies": { 4 | "gulp": "^3.8.8", 5 | "laravel-elixir": "*" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /phpspec.yml: -------------------------------------------------------------------------------- 1 | suites: 2 | main: 3 | namespace: App 4 | psr4_prefix: App 5 | src_path: app -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests/ 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes... 9 | RewriteRule ^(.*)/$ /$1 [L,R=301] 10 | 11 | # Handle Front Controller... 12 | RewriteCond %{REQUEST_FILENAME} !-d 13 | RewriteCond %{REQUEST_FILENAME} !-f 14 | RewriteRule ^ index.php [L] 15 | 16 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/public/favicon.ico -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/public/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/public/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/public/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/public/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /public/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/public/images/.gitkeep -------------------------------------------------------------------------------- /public/images/directory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/public/images/directory.png -------------------------------------------------------------------------------- /public/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael2h4ng/FileManager/c4c54a2c97679920a682794a06071ff3385e63ec/public/images/file.png -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader for 15 | | our application. We just need to utilize it! We'll simply require it 16 | | into the script here so that we don't have to worry about manual 17 | | loading any of our classes later on. It feels nice to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let us turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight our users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/app.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can handle the incoming request 43 | | through the kernel, and send the associated response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful application we have prepared for them. 46 | | 47 | */ 48 | 49 | $kernel = $app->make('Illuminate\Contracts\Http\Kernel'); 50 | 51 | $response = $kernel->handle( 52 | $request = Illuminate\Http\Request::capture() 53 | ); 54 | 55 | $response->send(); 56 | 57 | $kernel->terminate($request, $response); 58 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/assets/less/app.less: -------------------------------------------------------------------------------- 1 | @import "bootstrap/bootstrap"; 2 | 3 | @btn-font-weight: 300; 4 | @font-family-sans-serif: "Roboto", Helvetica, Arial, sans-serif; 5 | 6 | body, 7 | label, 8 | .checkbox label { 9 | font-weight: 300; 10 | } 11 | 12 | #actions { 13 | margin-bottom: 20px; 14 | 15 | #new_file { 16 | width: 36px; 17 | height: 34px; 18 | 19 | label { 20 | margin-left: -6px; 21 | 22 | .upload-icon { 23 | font-size: 18px; 24 | } 25 | } 26 | 27 | #fileupload { 28 | height: 40px; 29 | margin: -38px -15px; 30 | opacity: 0; 31 | overflow: hidden; 32 | padding: 0; 33 | width: 40px; 34 | cursor: inherit; 35 | } 36 | } 37 | } 38 | 39 | #file_system { 40 | 41 | &.loading { 42 | opacity: 0.6; 43 | } 44 | 45 | .object-container { 46 | height: 210px; 47 | overflow: hidden; 48 | } 49 | 50 | } 51 | 52 | .object { 53 | margin-bottom: 30px; 54 | padding-top: 10px; 55 | 56 | &.uploading, 57 | &.renaming { 58 | opacity: 0.6; 59 | cursor: progress; 60 | } 61 | 62 | &:hover { 63 | background-color: #e8f6fe; 64 | border-radius: 10px; 65 | } 66 | 67 | &.selected { 68 | background-color: #d1eefe; 69 | border-radius: 10px; 70 | } 71 | 72 | &:hover { 73 | a.rename { 74 | display: inline !important; 75 | } 76 | 77 | #rename-form ~ a.rename { 78 | display: none !important; 79 | } 80 | } 81 | 82 | .icon-container { 83 | overflow: hidden; 84 | 85 | .icon-base { 86 | height: 120px; 87 | } 88 | 89 | .icon-base.directory { 90 | background: url("../images/directory.png") no-repeat center center /contain; 91 | } 92 | 93 | .icon-base.file { 94 | background: url("../images/file.png") no-repeat center center /contain; 95 | } 96 | } 97 | 98 | .name-container { 99 | margin-top: 10px; 100 | text-align: center; 101 | 102 | .rename { 103 | outline: 0; 104 | } 105 | 106 | #input-folder, 107 | #input-file { 108 | width: 150px; 109 | margin-bottom: 5px; 110 | } 111 | } 112 | 113 | overflow: hidden; 114 | } 115 | 116 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissible alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 41 | .alert-dismissible { 42 | padding-right: (@alert-padding + 20); 43 | 44 | // Adjust close link position 45 | .close { 46 | position: relative; 47 | top: -2px; 48 | right: -21px; 49 | color: inherit; 50 | } 51 | } 52 | 53 | // Alternate styles 54 | // 55 | // Generate contextual modifier classes for colorizing the alert. 56 | 57 | .alert-success { 58 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 59 | } 60 | .alert-info { 61 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 62 | } 63 | .alert-warning { 64 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 65 | } 66 | .alert-danger { 67 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 68 | } 69 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | .btn-xs & { 32 | top: 0; 33 | padding: 1px 5px; 34 | } 35 | 36 | // Hover state, but only for links 37 | a& { 38 | &:hover, 39 | &:focus { 40 | color: @badge-link-hover-color; 41 | text-decoration: none; 42 | cursor: pointer; 43 | } 44 | } 45 | 46 | // Account for badges in navs 47 | .list-group-item.active > &, 48 | .nav-pills > .active > a > & { 49 | color: @badge-active-color; 50 | background-color: @badge-active-bg; 51 | } 52 | .list-group-item > & { 53 | float: right; 54 | } 55 | .list-group-item > & + & { 56 | margin-right: 5px; 57 | } 58 | .nav-pills > li > a > & { 59 | margin-left: 3px; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset and dependencies 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | @import "glyphicons.less"; 9 | 10 | // Core CSS 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | @import "tables.less"; 16 | @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "responsive-embed.less"; 39 | @import "wells.less"; 40 | @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | @import "modals.less"; 44 | @import "tooltip.less"; 45 | @import "popovers.less"; 46 | @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/buttons.less: -------------------------------------------------------------------------------- 1 | // 2 | // Buttons 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // -------------------------------------------------- 8 | 9 | .btn { 10 | display: inline-block; 11 | margin-bottom: 0; // For input.btn 12 | font-weight: @btn-font-weight; 13 | text-align: center; 14 | vertical-align: middle; 15 | touch-action: manipulation; 16 | cursor: pointer; 17 | background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 18 | border: 1px solid transparent; 19 | white-space: nowrap; 20 | .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @border-radius-base); 21 | .user-select(none); 22 | 23 | &, 24 | &:active, 25 | &.active { 26 | &:focus, 27 | &.focus { 28 | .tab-focus(); 29 | } 30 | } 31 | 32 | &:hover, 33 | &:focus, 34 | &.focus { 35 | color: @btn-default-color; 36 | text-decoration: none; 37 | } 38 | 39 | &:active, 40 | &.active { 41 | outline: 0; 42 | background-image: none; 43 | .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); 44 | } 45 | 46 | &.disabled, 47 | &[disabled], 48 | fieldset[disabled] & { 49 | cursor: @cursor-disabled; 50 | pointer-events: none; // Future-proof disabling of clicks 51 | .opacity(.65); 52 | .box-shadow(none); 53 | } 54 | } 55 | 56 | 57 | // Alternate buttons 58 | // -------------------------------------------------- 59 | 60 | .btn-default { 61 | .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border); 62 | } 63 | .btn-primary { 64 | .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border); 65 | } 66 | // Success appears as green 67 | .btn-success { 68 | .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border); 69 | } 70 | // Info appears as blue-green 71 | .btn-info { 72 | .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border); 73 | } 74 | // Warning appears as orange 75 | .btn-warning { 76 | .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border); 77 | } 78 | // Danger and error appear as red 79 | .btn-danger { 80 | .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border); 81 | } 82 | 83 | 84 | // Link buttons 85 | // ------------------------- 86 | 87 | // Make a button look and behave like a link 88 | .btn-link { 89 | color: @link-color; 90 | font-weight: normal; 91 | border-radius: 0; 92 | 93 | &, 94 | &:active, 95 | &.active, 96 | &[disabled], 97 | fieldset[disabled] & { 98 | background-color: transparent; 99 | .box-shadow(none); 100 | } 101 | &, 102 | &:hover, 103 | &:focus, 104 | &:active { 105 | border-color: transparent; 106 | } 107 | &:hover, 108 | &:focus { 109 | color: @link-hover-color; 110 | text-decoration: underline; 111 | background-color: transparent; 112 | } 113 | &[disabled], 114 | fieldset[disabled] & { 115 | &:hover, 116 | &:focus { 117 | color: @btn-link-disabled-color; 118 | text-decoration: none; 119 | } 120 | } 121 | } 122 | 123 | 124 | // Button Sizes 125 | // -------------------------------------------------- 126 | 127 | .btn-lg { 128 | // line-height: ensure even-numbered height of button next to large input 129 | .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large); 130 | } 131 | .btn-sm { 132 | // line-height: ensure proper height of button next to small input 133 | .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small); 134 | } 135 | .btn-xs { 136 | .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @border-radius-small); 137 | } 138 | 139 | 140 | // Block button 141 | // -------------------------------------------------- 142 | 143 | .btn-block { 144 | display: block; 145 | width: 100%; 146 | } 147 | 148 | // Vertically space out multiple block buttons 149 | .btn-block + .btn-block { 150 | margin-top: 5px; 151 | } 152 | 153 | // Specificity overrides 154 | input[type="submit"], 155 | input[type="reset"], 156 | input[type="button"] { 157 | &.btn-block { 158 | width: 100%; 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | visibility: hidden; 21 | 22 | &.in { display: block; visibility: visible; } 23 | tr&.in { display: table-row; } 24 | tbody&.in { display: table-row-group; } 25 | } 26 | 27 | .collapsing { 28 | position: relative; 29 | height: 0; 30 | overflow: hidden; 31 | .transition-property(~"height, visibility"); 32 | .transition-duration(.35s); 33 | .transition-timing-function(ease); 34 | } 35 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/dropdowns.less: -------------------------------------------------------------------------------- 1 | // 2 | // Dropdown menus 3 | // -------------------------------------------------- 4 | 5 | 6 | // Dropdown arrow/caret 7 | .caret { 8 | display: inline-block; 9 | width: 0; 10 | height: 0; 11 | margin-left: 2px; 12 | vertical-align: middle; 13 | border-top: @caret-width-base solid; 14 | border-right: @caret-width-base solid transparent; 15 | border-left: @caret-width-base solid transparent; 16 | } 17 | 18 | // The dropdown wrapper (div) 19 | .dropdown { 20 | position: relative; 21 | } 22 | 23 | // Prevent the focus on the dropdown toggle when closing dropdowns 24 | .dropdown-toggle:focus { 25 | outline: 0; 26 | } 27 | 28 | // The dropdown menu (ul) 29 | .dropdown-menu { 30 | position: absolute; 31 | top: 100%; 32 | left: 0; 33 | z-index: @zindex-dropdown; 34 | display: none; // none by default, but block on "open" of the menu 35 | float: left; 36 | min-width: 160px; 37 | padding: 5px 0; 38 | margin: 2px 0 0; // override default ul 39 | list-style: none; 40 | font-size: @font-size-base; 41 | text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer) 42 | background-color: @dropdown-bg; 43 | border: 1px solid @dropdown-fallback-border; // IE8 fallback 44 | border: 1px solid @dropdown-border; 45 | border-radius: @border-radius-base; 46 | .box-shadow(0 6px 12px rgba(0,0,0,.175)); 47 | background-clip: padding-box; 48 | 49 | // Aligns the dropdown menu to right 50 | // 51 | // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]` 52 | &.pull-right { 53 | right: 0; 54 | left: auto; 55 | } 56 | 57 | // Dividers (basically an hr) within the dropdown 58 | .divider { 59 | .nav-divider(@dropdown-divider-bg); 60 | } 61 | 62 | // Links within the dropdown menu 63 | > li > a { 64 | display: block; 65 | padding: 3px 20px; 66 | clear: both; 67 | font-weight: normal; 68 | line-height: @line-height-base; 69 | color: @dropdown-link-color; 70 | white-space: nowrap; // prevent links from randomly breaking onto new lines 71 | } 72 | } 73 | 74 | // Hover/Focus state 75 | .dropdown-menu > li > a { 76 | &:hover, 77 | &:focus { 78 | text-decoration: none; 79 | color: @dropdown-link-hover-color; 80 | background-color: @dropdown-link-hover-bg; 81 | } 82 | } 83 | 84 | // Active state 85 | .dropdown-menu > .active > a { 86 | &, 87 | &:hover, 88 | &:focus { 89 | color: @dropdown-link-active-color; 90 | text-decoration: none; 91 | outline: 0; 92 | background-color: @dropdown-link-active-bg; 93 | } 94 | } 95 | 96 | // Disabled state 97 | // 98 | // Gray out text and ensure the hover/focus state remains gray 99 | 100 | .dropdown-menu > .disabled > a { 101 | &, 102 | &:hover, 103 | &:focus { 104 | color: @dropdown-link-disabled-color; 105 | } 106 | 107 | // Nuke hover/focus effects 108 | &:hover, 109 | &:focus { 110 | text-decoration: none; 111 | background-color: transparent; 112 | background-image: none; // Remove CSS gradient 113 | .reset-filter(); 114 | cursor: @cursor-disabled; 115 | } 116 | } 117 | 118 | // Open state for the dropdown 119 | .open { 120 | // Show the menu 121 | > .dropdown-menu { 122 | display: block; 123 | } 124 | 125 | // Remove the outline when :focus is triggered 126 | > a { 127 | outline: 0; 128 | } 129 | } 130 | 131 | // Menu positioning 132 | // 133 | // Add extra class to `.dropdown-menu` to flip the alignment of the dropdown 134 | // menu with the parent. 135 | .dropdown-menu-right { 136 | left: auto; // Reset the default from `.dropdown-menu` 137 | right: 0; 138 | } 139 | // With v3, we enabled auto-flipping if you have a dropdown within a right 140 | // aligned nav component. To enable the undoing of that, we provide an override 141 | // to restore the default dropdown menu alignment. 142 | // 143 | // This is only for left-aligning a dropdown menu within a `.navbar-right` or 144 | // `.pull-right` nav component. 145 | .dropdown-menu-left { 146 | left: 0; 147 | right: auto; 148 | } 149 | 150 | // Dropdown section headers 151 | .dropdown-header { 152 | display: block; 153 | padding: 3px 20px; 154 | font-size: @font-size-small; 155 | line-height: @line-height-base; 156 | color: @dropdown-header-color; 157 | white-space: nowrap; // as with > li > a 158 | } 159 | 160 | // Backdrop to catch body clicks on mobile, etc. 161 | .dropdown-backdrop { 162 | position: fixed; 163 | left: 0; 164 | right: 0; 165 | bottom: 0; 166 | top: 0; 167 | z-index: (@zindex-dropdown - 10); 168 | } 169 | 170 | // Right aligned dropdowns 171 | .pull-right > .dropdown-menu { 172 | right: 0; 173 | left: auto; 174 | } 175 | 176 | // Allow for dropdowns to go bottom up (aka, dropup-menu) 177 | // 178 | // Just add .dropup after the standard .dropdown class and you're set, bro. 179 | // TODO: abstract this so that the navbar fixed styles are not placed here? 180 | 181 | .dropup, 182 | .navbar-fixed-bottom .dropdown { 183 | // Reverse the caret 184 | .caret { 185 | border-top: 0; 186 | border-bottom: @caret-width-base solid; 187 | content: ""; 188 | } 189 | // Different positioning for bottom up menu 190 | .dropdown-menu { 191 | top: auto; 192 | bottom: 100%; 193 | margin-bottom: 1px; 194 | } 195 | } 196 | 197 | 198 | // Component alignment 199 | // 200 | // Reiterate per navbar.less and the modified component alignment there. 201 | 202 | @media (min-width: @grid-float-breakpoint) { 203 | .navbar-right { 204 | .dropdown-menu { 205 | .dropdown-menu-right(); 206 | } 207 | // Necessary for overrides of the default right aligned menu. 208 | // Will remove come v4 in all likelihood. 209 | .dropdown-menu-left { 210 | .dropdown-menu-left(); 211 | } 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/input-groups.less: -------------------------------------------------------------------------------- 1 | // 2 | // Input groups 3 | // -------------------------------------------------- 4 | 5 | // Base styles 6 | // ------------------------- 7 | .input-group { 8 | position: relative; // For dropdowns 9 | display: table; 10 | border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table 11 | 12 | // Undo padding and float of grid classes 13 | &[class*="col-"] { 14 | float: none; 15 | padding-left: 0; 16 | padding-right: 0; 17 | } 18 | 19 | .form-control { 20 | // Ensure that the input is always above the *appended* addon button for 21 | // proper border colors. 22 | position: relative; 23 | z-index: 2; 24 | 25 | // IE9 fubars the placeholder attribute in text inputs and the arrows on 26 | // select elements in input groups. To fix it, we float the input. Details: 27 | // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855 28 | float: left; 29 | 30 | width: 100%; 31 | margin-bottom: 0; 32 | } 33 | } 34 | 35 | // Sizing options 36 | // 37 | // Remix the default form control sizing classes into new ones for easier 38 | // manipulation. 39 | 40 | .input-group-lg > .form-control, 41 | .input-group-lg > .input-group-addon, 42 | .input-group-lg > .input-group-btn > .btn { 43 | .input-lg(); 44 | } 45 | .input-group-sm > .form-control, 46 | .input-group-sm > .input-group-addon, 47 | .input-group-sm > .input-group-btn > .btn { 48 | .input-sm(); 49 | } 50 | 51 | 52 | // Display as table-cell 53 | // ------------------------- 54 | .input-group-addon, 55 | .input-group-btn, 56 | .input-group .form-control { 57 | display: table-cell; 58 | 59 | &:not(:first-child):not(:last-child) { 60 | border-radius: 0; 61 | } 62 | } 63 | // Addon and addon wrapper for buttons 64 | .input-group-addon, 65 | .input-group-btn { 66 | width: 1%; 67 | white-space: nowrap; 68 | vertical-align: middle; // Match the inputs 69 | } 70 | 71 | // Text input groups 72 | // ------------------------- 73 | .input-group-addon { 74 | padding: @padding-base-vertical @padding-base-horizontal; 75 | font-size: @font-size-base; 76 | font-weight: normal; 77 | line-height: 1; 78 | color: @input-color; 79 | text-align: center; 80 | background-color: @input-group-addon-bg; 81 | border: 1px solid @input-group-addon-border-color; 82 | border-radius: @border-radius-base; 83 | 84 | // Sizing 85 | &.input-sm { 86 | padding: @padding-small-vertical @padding-small-horizontal; 87 | font-size: @font-size-small; 88 | border-radius: @border-radius-small; 89 | } 90 | &.input-lg { 91 | padding: @padding-large-vertical @padding-large-horizontal; 92 | font-size: @font-size-large; 93 | border-radius: @border-radius-large; 94 | } 95 | 96 | // Nuke default margins from checkboxes and radios to vertically center within. 97 | input[type="radio"], 98 | input[type="checkbox"] { 99 | margin-top: 0; 100 | } 101 | } 102 | 103 | // Reset rounded corners 104 | .input-group .form-control:first-child, 105 | .input-group-addon:first-child, 106 | .input-group-btn:first-child > .btn, 107 | .input-group-btn:first-child > .btn-group > .btn, 108 | .input-group-btn:first-child > .dropdown-toggle, 109 | .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), 110 | .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { 111 | .border-right-radius(0); 112 | } 113 | .input-group-addon:first-child { 114 | border-right: 0; 115 | } 116 | .input-group .form-control:last-child, 117 | .input-group-addon:last-child, 118 | .input-group-btn:last-child > .btn, 119 | .input-group-btn:last-child > .btn-group > .btn, 120 | .input-group-btn:last-child > .dropdown-toggle, 121 | .input-group-btn:first-child > .btn:not(:first-child), 122 | .input-group-btn:first-child > .btn-group:not(:first-child) > .btn { 123 | .border-left-radius(0); 124 | } 125 | .input-group-addon:last-child { 126 | border-left: 0; 127 | } 128 | 129 | // Button input groups 130 | // ------------------------- 131 | .input-group-btn { 132 | position: relative; 133 | // Jankily prevent input button groups from wrapping with `white-space` and 134 | // `font-size` in combination with `inline-block` on buttons. 135 | font-size: 0; 136 | white-space: nowrap; 137 | 138 | // Negative margin for spacing, position for bringing hovered/focused/actived 139 | // element above the siblings. 140 | > .btn { 141 | position: relative; 142 | + .btn { 143 | margin-left: -1px; 144 | } 145 | // Bring the "active" button to the front 146 | &:hover, 147 | &:focus, 148 | &:active { 149 | z-index: 2; 150 | } 151 | } 152 | 153 | // Negative margin to only have a 1px border between the two 154 | &:first-child { 155 | > .btn, 156 | > .btn-group { 157 | margin-right: -1px; 158 | } 159 | } 160 | &:last-child { 161 | > .btn, 162 | > .btn-group { 163 | margin-left: -1px; 164 | } 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding (@jumbotron-padding / 2); 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | p { 17 | margin-bottom: (@jumbotron-padding / 2); 18 | font-size: @jumbotron-font-size; 19 | font-weight: 200; 20 | } 21 | 22 | > hr { 23 | border-top-color: darken(@jumbotron-bg, 10%); 24 | } 25 | 26 | .container &, 27 | .container-fluid & { 28 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 29 | } 30 | 31 | .container { 32 | max-width: 100%; 33 | } 34 | 35 | @media screen and (min-width: @screen-sm-min) { 36 | padding: (@jumbotron-padding * 1.6) 0; 37 | 38 | .container &, 39 | .container-fluid & { 40 | padding-left: (@jumbotron-padding * 2); 41 | padding-right: (@jumbotron-padding * 2); 42 | } 43 | 44 | h1, 45 | .h1 { 46 | font-size: (@font-size-base * 4.5); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/list-group.less: -------------------------------------------------------------------------------- 1 | // 2 | // List groups 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | // 8 | // Easily usable on