dym-sh/routes/web.php

41 lines
1.1 KiB
PHP
Raw Normal View History

2024-08-06 14:12:25 +02:00
<?php
2024-08-07 18:08:20 +02:00
use App\Http\Controllers\SessionController;
2024-08-06 14:12:25 +02:00
use Illuminate\Support\Facades\Route;
2024-08-07 18:08:20 +02:00
Route::view('/', 'index');
Route::view('/about', 'about');
2024-08-06 16:39:08 +02:00
2024-08-07 18:08:20 +02:00
Route::view('/graphics', 'graphics');
Route::view('/photos', 'photos');
Route::view('/comics', 'comics');
Route::view('/code', 'code');
Route::view('/notes', 'notes');
2024-08-07 15:33:25 +02:00
Route::name('pages.list')->get('/list', function () {
return view('list');
});
Route::name('admin.new')->get('/new', function () {
2024-08-07 18:08:20 +02:00
return view('admin.edit');
2024-08-07 13:37:14 +02:00
});
2024-08-07 18:08:20 +02:00
Route::name('admin.edit')->get('/edit', function () {
return view('admin.edit');
});
Route::name('admin.edit')->get('/edit/{slug}', function ($name = null) {
return view('admin.edit');
2024-08-07 15:33:25 +02:00
})->where('slug', '[A-Za-z0-9-]+');
Route::name('admin.index')->get('/admin', function ($name = null) {
2024-08-07 18:08:20 +02:00
return view('admin.index');
2024-08-07 15:33:25 +02:00
});
2024-08-07 18:08:20 +02:00
Route::get('/login', [SessionController::class, 'create']);
Route::post('/login', [SessionController::class, 'store']);
Route::post('/logout', [SessionController::class, 'destroy']);
2024-08-07 15:33:25 +02:00
Route::name('page.show')->get('/{slug}', function () {
return view('page');
})->where('slug', '[A-Za-z0-9-]+');