kuvia/routes/web.php

60 lines
3 KiB
PHP
Raw Normal View History

2021-01-11 11:49:50 +00:00
<?php
use Illuminate\Support\Facades\Route;
2021-01-12 14:49:45 +00:00
2021-01-11 11:49:50 +00:00
/*
|--------------------------------------------------------------------------
| 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!
|
*/
2021-01-12 14:49:45 +00:00
$middlewareGroups = [
'private' => [
\App\Http\Middleware\TenanMiddleware::class
],
];
Route::get("/register", [\App\Http\Controllers\AccountController::class, 'registerView']);
Route::post("/register", [\App\Http\Controllers\AccountController::class, 'register']);
Route::get("/login", [\App\Http\Controllers\AccountController::class, 'loginView']);
Route::post("/login", [\App\Http\Controllers\AccountController::class, 'login']);
Route::middleware([\App\Http\Middleware\TenanMiddleware::class])->group(function () {
Route::get("/d", [\App\Http\Controllers\DashboardController::class, 'dashboardView']);
Route::get("/t/new", [\App\Http\Controllers\TenantController::class, 'newView']);
Route::post("/t/new", [\App\Http\Controllers\TenantController::class, 'newTenant']);
Route::get("/t/select/{name}", [\App\Http\Controllers\TenantController::class, 'switchTenant']);
Route::get("/g", [\App\Http\Controllers\GalleryController::class, 'listView']);
Route::get("/g/new", [\App\Http\Controllers\GalleryController::class, 'newView']);
Route::post("/g/new", [\App\Http\Controllers\GalleryController::class, 'newGallery']);
Route::get("/g/{url}/upload", [\App\Http\Controllers\GalleryController::class, 'imagesUploadView']);
Route::post("/g/{url}/upload", [\App\Http\Controllers\GalleryController::class, 'imageUpload']);
2021-01-12 16:50:08 +00:00
Route::get("/g/{url}", [\App\Http\Controllers\GalleryController::class, 'showImagesView']);
2021-01-17 14:32:25 +00:00
Route::get("/g/{url}/edit", [\App\Http\Controllers\GalleryController::class, 'editGalleryView']);
Route::post("/g/{url}/edit", [\App\Http\Controllers\GalleryController::class, 'editGallery']);
2021-01-12 19:45:20 +00:00
Route::get("/g/{url}/setDefault", [\App\Http\Controllers\GalleryController::class, 'setDefault']);
2021-01-19 18:57:14 +00:00
Route::get("/g/{url}/delete", [\App\Http\Controllers\GalleryController::class, 'deleteImage']);
2021-01-19 23:41:02 +00:00
Route::post("/g/{url}/save", [\App\Http\Controllers\GalleryController::class, 'saveImage']);
2021-01-20 20:25:29 +00:00
Route::get("/s/watermark", [\App\Http\Controllers\TenantController::class, 'watermarkView']);
Route::post("/s/watermark", [\App\Http\Controllers\TenantController::class, 'watermarkSave']);
2021-01-12 14:49:45 +00:00
});
Route::get("/{name}", [\App\Http\Controllers\PublicController::class, 'listGalleriesView'])->middleware([\App\Http\Middleware\TenanMiddleware::class]);
Route::get("/{tenant}/{gallery}", [\App\Http\Controllers\PublicController::class, 'listGalleryImagesView'])->middleware([\App\Http\Middleware\TenanMiddleware::class]);
Route::get("/{tenant}/{gallery}/{image}/file", [\App\Http\Controllers\PublicController::class, 'returnImageFile']);
2021-01-11 11:49:50 +00:00
Route::get('/', function () {
2021-01-12 14:49:45 +00:00
return redirect("/login");
2021-01-11 11:49:50 +00:00
});