2026-05-20 18:25:15 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\EntryController;
|
2026-06-08 16:25:52 +02:00
|
|
|
use App\Http\Controllers\ModCP\LanguageController;
|
2026-05-27 21:24:38 +02:00
|
|
|
use App\Http\Controllers\WebhookController;
|
|
|
|
|
use Illuminate\Routing\RedirectController;
|
2026-05-20 18:25:15 +02:00
|
|
|
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');
|
2026-06-08 16:25:52 +02:00
|
|
|
Route::get('/{section}', 'section_redirect' )->name('section_redirect')
|
|
|
|
|
->where(['section' => 'translations|romhacks|homebrew|utilities|documents|lua-scripts|tutorials']);
|
|
|
|
|
|
2026-05-20 18:25:15 +02:00
|
|
|
Route::get('/{section}/{entry:slug}', 'show' )->name('show')->where(
|
|
|
|
|
[
|
|
|
|
|
'section' => 'translations|romhacks|homebrew|utilities|documents|lua-scripts|tutorials',
|
2026-05-27 21:24:38 +02:00
|
|
|
'entry' => '[a-zA-Z0-9\-_]+'
|
2026-05-20 18:25:15 +02:00
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
|
2026-06-08 16:25:52 +02:00
|
|
|
Route::get('/my-drafts', 'drafts' )->middleware('xf.auth')->name('drafts');
|
|
|
|
|
|
2026-05-20 18:25:15 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// SubmissionController.
|
2026-05-27 21:24:38 +02:00
|
|
|
Route::name('submit.')->prefix('/submit')->controller(\App\Http\Controllers\SubmissionController::class)->middleware(['xf.auth', 'can:create,\App\Models\Entry'])->group(function () {
|
2026-05-20 18:25:15 +02:00
|
|
|
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' ]);
|
|
|
|
|
});
|
2026-05-27 21:24:38 +02:00
|
|
|
Route::name('submit.')->prefix('/edit')->controller(\App\Http\Controllers\SubmissionController::class)->middleware(['xf.auth', 'can:update,entry'])->group(function () {
|
2026-05-20 18:25:15 +02:00
|
|
|
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\-]+' ]);
|
2026-06-08 16:25:52 +02:00
|
|
|
Route::delete('/{section}/{entry:id}', 'destroy' )->name('destroy')
|
|
|
|
|
->where([ 'section' => 'translations|romhacks|homebrew|utilities|documents|lua-scripts|tutorials', 'entry' => '[0-9\-]+' ]);
|
2026-05-20 18:25:15 +02:00
|
|
|
});
|
|
|
|
|
|
2026-06-02 20:54:10 +02:00
|
|
|
// 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');
|
|
|
|
|
});
|
|
|
|
|
|
2026-06-08 16:25:52 +02:00
|
|
|
// ToolsController
|
|
|
|
|
Route::name('tools.')->controller(\App\Http\Controllers\ToolsController::class)->group(function () {
|
|
|
|
|
Route::get('/patch', 'patcher' )->name('patcher');
|
2026-06-09 11:45:59 +02:00
|
|
|
Route::get( '/patch/{entry_id}/{file:file_uuid}', 'directPatch' )->name('direct-patch')
|
|
|
|
|
->where(['entry_id' => '[0-9]+']);
|
2026-06-08 16:25:52 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// ModeratorCPController
|
|
|
|
|
Route::name('modcp.')->prefix('/modcp')->controller(\App\Http\Controllers\ModCPController::class)->middleware(['xf.auth','can:is-mod'])->group(function () {
|
|
|
|
|
|
|
|
|
|
Route::get('/', 'index' )->name('index');
|
|
|
|
|
Route::get('/locked-entries', 'locked' )->name('locked');
|
|
|
|
|
Route::get('/draft-entries', 'draft' )->name('draft')->middleware('can:is-admin');
|
|
|
|
|
Route::get('/hidden-entries', 'hidden' )->name('hidden')->middleware('can:is-admin');
|
|
|
|
|
Route::get('/deleted-entries', 'deleted' )->name('deleted')->middleware('can:is-admin');
|
|
|
|
|
|
|
|
|
|
Route::patch('/restore/{entry}', 'restore' )->name('restore')->where(['entry' => '[0-9\-]+'])->withTrashed()->middleware('can:is-admin');
|
|
|
|
|
Route::delete('/purge/{entry}', 'destroy' )->name('destroy')->where(['entry' => '[0-9\-]+'])->withTrashed()->middleware('can:is-admin');
|
|
|
|
|
|
|
|
|
|
Route::resource('games', \App\Http\Controllers\ModCP\GameController::class)->only(['index', 'store','update','destroy']);
|
|
|
|
|
Route::resource('languages', LanguageController::class)->only(['index', 'store','update','destroy']);
|
|
|
|
|
Route::resource('authors', \App\Http\Controllers\ModCP\AuthorController::class)->only(['index', 'store','update','destroy']);
|
|
|
|
|
Route::resource('platforms', \App\Http\Controllers\ModCP\PlatformController::class )->middleware('can:is-admin')->only(['index', 'store','update','destroy']);
|
|
|
|
|
Route::resource('genres', \App\Http\Controllers\ModCP\GenreController::class )->middleware('can:is-admin')->only(['index', 'store','update','destroy']);
|
|
|
|
|
});
|
|
|
|
|
|
2026-05-27 21:24:38 +02:00
|
|
|
// RedirectController
|
|
|
|
|
Route::name('redirect.')->controller(\App\Http\Controllers\RedirectController::class)->group(function () {
|
|
|
|
|
Route::get('/entry/report_redirect', 'entryReportRedirect' )->name('entry_report');
|
2026-05-24 11:47:20 +02:00
|
|
|
});
|