Files
RomhackPlaza/routes/web.php
2026-06-02 20:54:10 +02:00

63 lines
2.7 KiB
PHP

<?php
use App\Http\Controllers\EntryController;
use App\Http\Controllers\WebhookController;
use Illuminate\Routing\RedirectController;
use Illuminate\Support\Facades\Route;
// HomeController.
Route::get('/', [ \App\Http\Controllers\HomeController::class, 'index' ] )->name('home');
// EntryController.
Route::name('entries.')->controller(EntryController::class)->group(function () {
Route::get('/database', 'index' )->name('index');
Route::get('/{section}/{entry:slug}', 'show' )->name('show')->where(
[
'section' => 'translations|romhacks|homebrew|utilities|documents|lua-scripts|tutorials',
'entry' => '[a-zA-Z0-9\-_]+'
]
);
});
// SubmissionController.
Route::name('submit.')->prefix('/submit')->controller(\App\Http\Controllers\SubmissionController::class)->middleware(['xf.auth', 'can:create,\App\Models\Entry'])->group(function () {
Route::get('/{section}', 'create' )->name('create')
->where([ 'section' => 'translations|romhacks|homebrew|utilities|documents|lua-scripts|tutorials' ]);
Route::post('/{section}', 'store' )->name('store')
->where([ 'section' => 'translations|romhacks|homebrew|utilities|documents|lua-scripts|tutorials' ]);
});
Route::name('submit.')->prefix('/edit')->controller(\App\Http\Controllers\SubmissionController::class)->middleware(['xf.auth', 'can:update,entry'])->group(function () {
Route::get('/{section}/{entry:id}', 'edit' )->name('edit')
->where([ 'section' => 'translations|romhacks|homebrew|utilities|documents|lua-scripts|tutorials', 'entry' => '[0-9\-]+' ]);
Route::post('/{section}/{entry:id}', 'update' )->name('update')
->where([ 'section' => 'translations|romhacks|homebrew|utilities|documents|lua-scripts|tutorials', 'entry' => '[0-9\-]+' ]);
});
// QueueController
Route::name('queue.')->prefix('/queue')->controller(\App\Http\Controllers\QueueController::class)->group(function () {
Route::get('/', 'index' )->name('index');
Route::patch('/{entry:id}/comment', 'updateComment' )
->middleware(['xf.auth', 'can:updateComment,entry' ] )
->where([ 'entry' => '[0-9\-]+' ])
->name('comment');
Route::patch('/{entry:id}/approve', 'approve' )
->middleware(['xf.auth', 'can:approve,entry' ] )
->where([ 'entry' => '[0-9\-]+' ])
->name('approve');
Route::patch('/{entry:id}/reject', 'reject' )
->middleware(['xf.auth', 'can:reject,entry' ] )
->where([ 'entry' => '[0-9\-]+' ])
->name('reject');
});
// RedirectController
Route::name('redirect.')->controller(\App\Http\Controllers\RedirectController::class)->group(function () {
Route::get('/entry/report_redirect', 'entryReportRedirect' )->name('entry_report');
});