2026-05-20 18:25:15 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\EntryController;
|
|
|
|
|
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:romhackplaza.canSubmitEntry')->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:romhackplaza.canSubmitEntry')->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\-]+' ]);
|
|
|
|
|
});
|
|
|
|
|
|
2026-05-24 11:47:20 +02:00
|
|
|
/* API ROUTES */
|
|
|
|
|
|
2026-05-20 18:25:15 +02:00
|
|
|
// FileServerController
|
|
|
|
|
Route::name('fs.')->controller(\App\Http\Controllers\FileServerController::class)->group(function () {
|
|
|
|
|
Route::post('/api/fs/upload-chunk/{section}', 'uploadChunk' )->name('uploadchunk')
|
|
|
|
|
->where([ 'section' => 'translations|romhacks|homebrew|utilities|documents|lua-scripts|tutorials' ])
|
|
|
|
|
->middleware('xf.auth:romhackplaza.canSubmitEntry');
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
Route::get( '/api/fs/download/{entry_id}/{file:file_uuid}', 'download' )->name('download')
|
|
|
|
|
->where(['entry_id' => '[0-9]+']);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// TemporaryFileController
|
|
|
|
|
Route::name('tempfile.')->controller(\App\Http\Controllers\TemporaryFileController::class)->group(function () {
|
|
|
|
|
Route::post('/api/tempfile/upload', 'upload' )->name('upload')
|
|
|
|
|
->middleware('xf.auth:romhackplaza.canSubmitTempFile');
|
|
|
|
|
});
|
2026-05-24 11:47:20 +02:00
|
|
|
|
|
|
|
|
// DynamicLoadController
|
|
|
|
|
Route::get( '/api/dynamic/hovercard/{user_id}', [ \App\Http\Controllers\DynamicLoadController::class, 'hovercard' ] )
|
|
|
|
|
->where(['user_id' => '[0-9]+'])
|
|
|
|
|
->name('dynamic.hovercard')
|
|
|
|
|
->middleware('throttle:60,1')
|
|
|
|
|
;
|
|
|
|
|
Route::middleware('xf.auth')->controller(\App\Http\Controllers\DynamicLoadController::class)->name('dynamic.')->prefix('/api/dynamic/')->group(function(){
|
|
|
|
|
Route::get('/notifications', 'getNotifications' )->name('notifications');
|
|
|
|
|
Route::post('/notifications/mark-all-read', 'markAllRead' )->name('markallread');
|
2026-05-25 09:55:47 +02:00
|
|
|
Route::get('/conversations', 'getConversations' )->name('conversations');
|
2026-05-24 11:47:20 +02:00
|
|
|
});
|