Files
laravel-manager-packagist/routes/manager.php
T
2026-12-04 16:52:00 +00:00

28 lines
1.9 KiB
PHP

<?php
use Illuminate\Support\Facades\Route;
use IriksIT\Manager\Http\Controllers\DashboardController;
use IriksIT\Manager\Http\Controllers\LoginController;
use IriksIT\Manager\Http\Controllers\MarkdownController;
use IriksIT\Manager\Http\Controllers\ProfileController;
use IriksIT\Manager\Http\Controllers\TwoFactorController;
Route::get('/', DashboardController::class)->name('dashboard');
Route::get('/profile', [ProfileController::class, 'show'])->name('profile.show');
Route::put('/profile', [ProfileController::class, 'update'])->name('profile.update');
Route::put('/profile/view', [ProfileController::class, 'view'])->name('profile.view');
Route::put('/profile/tutorial', [ProfileController::class, 'tutorial'])->name('profile.tutorial');
// The second step of the login (ADR-0016). The gate (`manager.two-factor`) lets only the first three and the logout through before it is passed.
Route::get('/two-factor', [TwoFactorController::class, 'status'])->name('two_factor.status');
Route::post('/two-factor/challenge', [TwoFactorController::class, 'challenge'])->name('two_factor.challenge');
Route::post('/two-factor/setup', [TwoFactorController::class, 'setup'])->name('two_factor.setup');
Route::post('/two-factor/confirm', [TwoFactorController::class, 'confirm'])->name('two_factor.confirm');
Route::delete('/two-factor', [TwoFactorController::class, 'disable'])->name('two_factor.disable');
Route::post('/two-factor/recovery-codes', [TwoFactorController::class, 'recoveryCodes'])->name('two_factor.recovery');
Route::post('/markdown', MarkdownController::class)->name('markdown.preview')->middleware('throttle:120,1');
Route::post('/logout', [LoginController::class, 'destroy'])->name('logout');
// A screen that exists only in the bundle of the site (`manager.extensions`) has no route of its own: a browser that
// asks for it gets the shell, which shows the screen. Anything else that asks for data gets a plain 404.
Route::fallback(fn () => abort(404));