2016-07-21 22:01:57 +08:00
|
|
|
<?php
|
2016-08-28 10:05:21 +08:00
|
|
|
|
2019-04-25 13:01:39 +08:00
|
|
|
use App\Http\Middleware;
|
|
|
|
|
2016-07-21 22:01:57 +08:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Application Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register all of the routes for an application.
|
2016-08-28 10:05:21 +08:00
|
|
|
| It's a breeze. Simply tell Laravel the URIs it should respond to
|
|
|
|
| and give it the controller to call when that URI is requested.
|
2016-07-21 22:01:57 +08:00
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::get('', 'HomeController@index');
|
2016-09-24 22:45:54 +08:00
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::prefix('auth')->name('auth.')->group(function () {
|
|
|
|
Route::middleware('guest')->group(function () {
|
|
|
|
Route::get('login', 'AuthController@login')->name('login');
|
2020-07-19 15:22:03 +08:00
|
|
|
Route::post('login', 'AuthController@handleLogin');
|
2016-09-14 23:27:02 +08:00
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::get('register', 'AuthController@register')->name('register');
|
2020-07-19 15:22:03 +08:00
|
|
|
Route::post('register', 'AuthController@handleRegister');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::get('forgot', 'AuthController@forgot')->name('forgot');
|
2020-07-19 15:22:03 +08:00
|
|
|
Route::post('forgot', 'AuthController@handleForgot');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2020-03-28 22:36:27 +08:00
|
|
|
Route::get('reset/{uid}', 'AuthController@reset')->name('reset');
|
2020-07-19 15:22:03 +08:00
|
|
|
Route::post('reset/{uid}', 'AuthController@handleReset');
|
2018-08-17 12:32:44 +08:00
|
|
|
});
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::post('logout', 'AuthController@logout')->name('logout')->middleware('authorize');
|
|
|
|
Route::any('captcha', 'AuthController@captcha');
|
2019-04-25 23:24:24 +08:00
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::middleware(['authorize', Middleware\EnsureEmailFilled::class])
|
|
|
|
->group(function () {
|
|
|
|
Route::view('bind', 'auth.bind');
|
|
|
|
Route::post('bind', 'AuthController@fillEmail');
|
|
|
|
});
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2020-08-31 19:48:31 +08:00
|
|
|
Route::get('verify/{user}', 'AuthController@verify')->name('verify');
|
|
|
|
Route::post('verify/{user}', 'AuthController@handleVerify');
|
2016-07-21 22:01:57 +08:00
|
|
|
});
|
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::prefix('user')
|
|
|
|
->name('user.')
|
2020-06-03 14:47:44 +08:00
|
|
|
->middleware(['authorize'])
|
2020-01-13 08:37:57 +08:00
|
|
|
->group(function () {
|
|
|
|
Route::get('', 'UserController@index')->name('home');
|
2020-06-30 09:28:22 +08:00
|
|
|
Route::post('notifications/{id}', 'NotificationsController@read')->name('notification');
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::get('score-info', 'UserController@scoreInfo')->name('score');
|
|
|
|
Route::post('sign', 'UserController@sign')->name('sign');
|
|
|
|
|
2020-01-21 11:07:20 +08:00
|
|
|
Route::get('reports', 'ReportController@track');
|
2020-01-13 08:37:57 +08:00
|
|
|
|
2020-05-30 10:44:36 +08:00
|
|
|
Route::prefix('profile')->name('profile.')->group(function () {
|
|
|
|
Route::get('', 'UserController@profile');
|
|
|
|
Route::post('', 'UserController@handleProfile');
|
|
|
|
Route::post('avatar', 'UserController@setAvatar')->name('avatar');
|
2020-01-13 08:37:57 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
Route::post('email-verification', 'UserController@sendVerificationEmail');
|
|
|
|
|
|
|
|
Route::prefix('player')
|
|
|
|
->name('player.')
|
|
|
|
->middleware('verified')
|
|
|
|
->group(function () {
|
|
|
|
Route::get('', 'PlayerController@index')->name('page');
|
2020-05-09 10:11:07 +08:00
|
|
|
Route::get('list', 'PlayerController@list')->name('list');
|
2020-06-03 09:02:25 +08:00
|
|
|
Route::post('', 'PlayerController@add')->name('add');
|
|
|
|
Route::put('{player}/textures', 'PlayerController@setTexture')->name('set');
|
|
|
|
Route::delete('{player}/textures', 'PlayerController@clearTexture')->name('clear');
|
|
|
|
Route::put('{player}/name', 'PlayerController@rename')->name('rename');
|
|
|
|
Route::delete('{player}', 'PlayerController@delete')->name('delete');
|
2020-01-13 08:37:57 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
Route::prefix('closet')->name('closet.')->group(function () {
|
|
|
|
Route::get('', 'ClosetController@index')->name('page');
|
|
|
|
Route::get('list', 'ClosetController@getClosetData')->name('list');
|
2020-03-24 18:05:46 +08:00
|
|
|
Route::get('ids', 'ClosetController@allIds')->name('ids');
|
2020-05-29 09:09:10 +08:00
|
|
|
Route::post('', 'ClosetController@add')->name('add');
|
|
|
|
Route::put('{tid}', 'ClosetController@rename')->name('rename');
|
|
|
|
Route::delete('{tid}', 'ClosetController@remove')->name('remove');
|
2020-01-13 08:37:57 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
// OAuth2 Management
|
|
|
|
Route::view('oauth/manage', 'user.oauth')->middleware('verified');
|
2019-09-08 18:57:19 +08:00
|
|
|
});
|
|
|
|
|
2020-06-05 23:35:49 +08:00
|
|
|
Route::prefix('texture')->name('texture.')->group(function () {
|
|
|
|
Route::get('{texture}', 'SkinlibController@info')->name('info');
|
|
|
|
Route::middleware(['authorize', 'verified'])->group(function () {
|
|
|
|
Route::post('', 'SkinlibController@handleUpload')->name('upload');
|
|
|
|
Route::prefix('{texture}')->group(function () {
|
|
|
|
Route::put('type', 'SkinlibController@type')->name('type');
|
|
|
|
Route::put('name', 'SkinlibController@rename')->name('name');
|
|
|
|
Route::put('privacy', 'SkinlibController@privacy')->name('privacy');
|
|
|
|
Route::delete('', 'SkinlibController@delete')->name('delete');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::prefix('skinlib')->name('skinlib.')->group(function () {
|
|
|
|
Route::view('', 'skinlib.index')->name('home');
|
2020-06-04 18:12:58 +08:00
|
|
|
Route::get('info/{texture}', 'SkinlibController@info')->name('info');
|
2020-08-20 08:48:53 +08:00
|
|
|
Route::get('show/{texture}', 'SkinlibController@show')->name('show');
|
2020-03-24 18:05:46 +08:00
|
|
|
Route::get('list', 'SkinlibController@library')->name('list');
|
2020-01-13 08:37:57 +08:00
|
|
|
|
|
|
|
Route::middleware(['authorize', 'verified'])->group(function () {
|
2020-06-05 23:35:49 +08:00
|
|
|
Route::get('upload', 'SkinlibController@upload');
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::post('report', 'ReportController@submit');
|
2016-12-17 19:52:59 +08:00
|
|
|
});
|
2020-01-13 08:37:57 +08:00
|
|
|
});
|
2016-12-17 19:52:59 +08:00
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::prefix('admin')
|
|
|
|
->name('admin.')
|
2020-01-13 09:25:07 +08:00
|
|
|
->middleware(['authorize', 'role:admin'])
|
2020-01-13 08:37:57 +08:00
|
|
|
->group(function () {
|
|
|
|
Route::get('', 'AdminController@index');
|
|
|
|
Route::get('chart', 'AdminController@chartData');
|
2020-05-08 23:16:13 +08:00
|
|
|
Route::post('notifications/send', 'NotificationsController@send');
|
2020-01-13 08:37:57 +08:00
|
|
|
|
2020-05-27 17:28:24 +08:00
|
|
|
Route::any('customize', 'OptionsController@customize');
|
|
|
|
Route::any('score', 'OptionsController@score');
|
|
|
|
Route::any('options', 'OptionsController@options');
|
|
|
|
Route::any('resource', 'OptionsController@resource');
|
2020-01-13 08:37:57 +08:00
|
|
|
|
|
|
|
Route::get('status', 'AdminController@status');
|
|
|
|
|
2020-05-13 18:12:01 +08:00
|
|
|
Route::prefix('users')->name('users.')->group(function () {
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::view('', 'admin.users');
|
2020-05-13 18:12:01 +08:00
|
|
|
Route::get('list', 'UsersManagementController@list')->name('list');
|
|
|
|
Route::prefix('{user}')->group(function () {
|
|
|
|
Route::put('email', 'UsersManagementController@email')->name('email');
|
|
|
|
Route::put('verification', 'UsersManagementController@verification')->name('verification');
|
|
|
|
Route::put('nickname', 'UsersManagementController@nickname')->name('nickname');
|
|
|
|
Route::put('password', 'UsersManagementController@password')->name('password');
|
|
|
|
Route::put('score', 'UsersManagementController@score')->name('score');
|
|
|
|
Route::put('permission', 'UsersManagementController@permission')->name('permission');
|
|
|
|
Route::delete('', 'UsersManagementController@delete')->name('delete');
|
|
|
|
});
|
2020-01-13 08:37:57 +08:00
|
|
|
});
|
|
|
|
|
2020-05-10 23:34:04 +08:00
|
|
|
Route::prefix('players')->name('players.')->group(function () {
|
2020-05-13 18:12:01 +08:00
|
|
|
Route::view('', 'admin.players');
|
|
|
|
Route::get('list', 'PlayersManagementController@list')->name('list');
|
2020-05-10 23:34:04 +08:00
|
|
|
Route::prefix('{player}')->group(function () {
|
|
|
|
Route::put('name', 'PlayersManagementController@name')->name('name');
|
|
|
|
Route::put('owner', 'PlayersManagementController@owner')->name('owner');
|
|
|
|
Route::put('textures', 'PlayersManagementController@texture')->name('texture');
|
|
|
|
Route::delete('', 'PlayersManagementController@delete')->name('delete');
|
|
|
|
});
|
2020-05-13 18:12:01 +08:00
|
|
|
});
|
2020-01-13 08:37:57 +08:00
|
|
|
|
2020-03-21 17:30:44 +08:00
|
|
|
Route::prefix('closet')->group(function () {
|
2020-06-07 10:54:26 +08:00
|
|
|
Route::post('{user}', 'ClosetManagementController@add');
|
|
|
|
Route::delete('{user}', 'ClosetManagementController@remove');
|
2020-03-21 17:30:44 +08:00
|
|
|
});
|
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::prefix('reports')->group(function () {
|
|
|
|
Route::view('', 'admin.reports');
|
2020-05-15 11:05:04 +08:00
|
|
|
Route::put('{report}', 'ReportController@review');
|
|
|
|
Route::get('list', 'ReportController@manage');
|
2020-01-13 08:37:57 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
Route::prefix('i18n')->group(function () {
|
|
|
|
Route::view('', 'admin.i18n');
|
|
|
|
Route::get('list', 'TranslationsController@list');
|
|
|
|
Route::post('', 'TranslationsController@create');
|
2020-06-16 09:50:30 +08:00
|
|
|
Route::put('{line}', 'TranslationsController@update');
|
|
|
|
Route::delete('{line}', 'TranslationsController@delete');
|
2020-01-13 08:37:57 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
Route::prefix('plugins')->group(function () {
|
|
|
|
Route::get('data', 'PluginController@getPluginData');
|
|
|
|
|
|
|
|
Route::view('manage', 'admin.plugins');
|
|
|
|
Route::post('manage', 'PluginController@manage');
|
|
|
|
Route::any('config/{name}', 'PluginController@config');
|
|
|
|
Route::get('readme/{name}', 'PluginController@readme');
|
2020-05-12 18:50:58 +08:00
|
|
|
Route::middleware('role:super-admin')->group(function () {
|
|
|
|
Route::post('upload', 'PluginController@upload');
|
|
|
|
Route::post('wget', 'PluginController@wget');
|
|
|
|
});
|
2020-01-13 08:37:57 +08:00
|
|
|
|
|
|
|
Route::prefix('market')->group(function () {
|
|
|
|
Route::view('', 'admin.market');
|
|
|
|
Route::get('list', 'MarketController@marketData');
|
|
|
|
Route::post('download', 'MarketController@download');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-01-13 09:25:07 +08:00
|
|
|
Route::prefix('update')->middleware('role:super-admin')->group(function () {
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::get('', 'UpdateController@showUpdatePage');
|
|
|
|
Route::post('download', 'UpdateController@download');
|
|
|
|
});
|
2016-12-17 19:52:59 +08:00
|
|
|
});
|
2019-09-06 23:53:47 +08:00
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::prefix('setup')->group(function () {
|
|
|
|
Route::middleware('setup')->group(function () {
|
|
|
|
Route::view('', 'setup.wizard.welcome');
|
|
|
|
Route::any('database', 'SetupController@database');
|
|
|
|
Route::view('info', 'setup.wizard.info');
|
|
|
|
Route::post('finish', 'SetupController@finish');
|
2019-09-06 23:53:47 +08:00
|
|
|
});
|
|
|
|
});
|