52 lines
2.2 KiB
PHP
52 lines
2.2 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\ProfileController;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Inertia\Inertia;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
*/
|
|
|
|
Route::redirect('/', '/files');
|
|
|
|
Route::controller(\App\Http\Controllers\FileController::class)->middleware(['auth', 'verified'])->group(function () {
|
|
Route::get('/files/{folder?}', 'userFiles')
|
|
->where('folder', '(.*)')
|
|
->name('userFiles');
|
|
Route::get('/shared-with-me/{folder?}', 'sharedWithMe')
|
|
->where('folder', '(.*)')
|
|
->name('sharedWith');
|
|
Route::get('/shared-by-me/{folder?}', 'sharedByMe')
|
|
->where('folder', '(.*)')
|
|
->name('sharedBy');
|
|
Route::get('/recycle-bin/{folder?}', 'recycleBin')
|
|
->where('folder', '(.*)')
|
|
->name('recycleBin');
|
|
Route::post('/folder/new', 'newFolder')->name('folder.new');
|
|
Route::post('/file/upload', 'upload')->name('file.upload');
|
|
Route::get('/file/download', 'download')->name('file.download');
|
|
Route::get('/file/download-shared-by', 'downloadSharedBy')->name('file.downloadSharedBy');
|
|
Route::get('/file/download-shared-with', 'downloadSharedWith')->name('file.downloadSharedWith');
|
|
Route::post('/file/recycle', 'recycle')->name('file.recycle');
|
|
Route::post('/file/restore', 'restore')->name('file.restore');
|
|
Route::post('/file/delete', 'delete')->name('file.delete');
|
|
Route::post('/file/share', 'share')->name('file.share');
|
|
Route::post('/file/unshare', 'unshare')->name('file.unshare');
|
|
});
|
|
|
|
Route::middleware('auth')->group(function () {
|
|
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
|
|
Route::post('/profile', [ProfileController::class, 'update'])->name('profile.update');
|
|
Route::post('/profile/delete', [ProfileController::class, 'destroy'])->name('profile.destroy');
|
|
});
|
|
|
|
require __DIR__.'/auth.php';
|