laravel-vue-file-share/routes/web.php
2023-10-17 22:45:04 -07:00

51 lines
2.1 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', 'downloadShared')->name('file.downloadShared');
Route::post('/file/recycle', 'recycle')->name('file.recycle');
Route::post('/file/restore', 'restore')->name('file.restore');
Route::delete('/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::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
});
require __DIR__.'/auth.php';