File: database/migrations/2017_07_12_233302_create_files_table.php
$table->increments('id');
$table->text('name');
$table->text('basename')->nullable();
$table->string('extension')->nullable();
$table->text('description')->nullable();
$table->boolean('favorite')->default(false);
$table->integer('parent_id')->default(0);
$table->integer('type')->default(1); // 1.File, 2.Folder
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users');
$table->timestamps();
$table->softDeletes();
File: app/File.php
File: routes/web.php
// Files
Route::get('/file/byUser/{parentId?}', 'FileController@byUser');
Route::post('/file/store', 'FileController@store');
Route::put('/file/update/{id}', 'FileController@update');
Route::delete('/file/destroy/{id}', 'FileController@destroy');
Route::get('/files/{folderId?}', 'FileController@view');
File: app/Http/Controllers/FileController.php
File: resources/views/files.blade.php
Folder: resources/assets/js/components