2016-07-21 22:01:57 +08:00
|
|
|
<?php
|
2016-08-28 10:05:21 +08:00
|
|
|
|
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
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::get('/', 'HomeController@index');
|
|
|
|
Route::get('/index.php', 'HomeController@index');
|
|
|
|
|
|
|
|
Route::get('/locale/{lang}', 'HomeController@locale');
|
2016-09-14 23:27:02 +08:00
|
|
|
|
2016-07-21 22:01:57 +08:00
|
|
|
/**
|
|
|
|
* Auth
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'auth'], function()
|
|
|
|
{
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::group(['middleware' => 'App\Http\Middleware\RedirectIfAuthenticated'], function()
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::get ('/login', 'AuthController@login');
|
|
|
|
Route::get ('/register', 'AuthController@register');
|
|
|
|
Route::get ('/forgot', 'AuthController@forgot');
|
|
|
|
Route::get ('/reset', 'AuthController@reset');
|
2016-07-21 22:01:57 +08:00
|
|
|
});
|
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::any('/logout', 'AuthController@logout');
|
|
|
|
Route::any('/captcha', 'AuthController@captcha');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::post('/login', 'AuthController@handleLogin');
|
|
|
|
Route::post('/register', 'AuthController@handleRegister');
|
|
|
|
Route::post('/forgot', 'AuthController@handleForgot');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::post('/reset', 'AuthController@handleReset');
|
2016-07-21 22:01:57 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* User Center
|
|
|
|
*/
|
2016-08-28 10:05:21 +08:00
|
|
|
Route::group(['middleware' => 'App\Http\Middleware\CheckAuthenticated', 'prefix' => 'user'], function()
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2016-08-28 10:05:21 +08:00
|
|
|
Route::any ('', 'UserController@index');
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::any ('/checkin', 'UserController@checkIn');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
|
|
|
// Profile
|
|
|
|
Route::get ('/profile', 'UserController@profile');
|
|
|
|
Route::post('/profile', 'UserController@handleProfile');
|
|
|
|
Route::post('/profile/avatar', 'UserController@setAvatar');
|
|
|
|
Route::get ('/config', 'UserController@config');
|
|
|
|
|
|
|
|
// Player
|
2016-08-28 10:05:21 +08:00
|
|
|
Route::any ('/player', 'PlayerController@index');
|
2016-07-21 22:01:57 +08:00
|
|
|
Route::post('/player/add', 'PlayerController@add');
|
|
|
|
Route::post('/player/show', 'PlayerController@show');
|
|
|
|
Route::post('/player/preference', 'PlayerController@setPreference');
|
|
|
|
Route::post('/player/set', 'PlayerController@setTexture');
|
|
|
|
Route::post('/player/texture', 'PlayerController@changeTexture');
|
|
|
|
Route::post('/player/texture/clear', 'PlayerController@clearTexture');
|
|
|
|
Route::post('/player/rename', 'PlayerController@rename');
|
|
|
|
Route::post('/player/delete', 'PlayerController@delete');
|
|
|
|
|
|
|
|
// Closet
|
|
|
|
Route::get ('/closet', 'ClosetController@index');
|
|
|
|
Route::post('/closet/add', 'ClosetController@add');
|
|
|
|
Route::post('/closet/remove', 'ClosetController@remove');
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Skin Library
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'skinlib'], function()
|
|
|
|
{
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::get ('', 'SkinlibController@index');
|
|
|
|
Route::any ('/info/{tid}', 'SkinlibController@info');
|
|
|
|
Route::any ('/show', 'SkinlibController@show');
|
|
|
|
Route::any ('/search', 'SkinlibController@search');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::group(['middleware' => 'App\Http\Middleware\CheckAuthenticated'], function()
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::get ('/upload', 'SkinlibController@upload');
|
|
|
|
Route::post('/upload', 'SkinlibController@handleUpload');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::post('/rename', 'SkinlibController@rename');
|
|
|
|
Route::post('/privacy/{tid}', 'SkinlibController@privacy');
|
|
|
|
Route::post('/delete', 'SkinlibController@delete');
|
2016-07-21 22:01:57 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-22 19:36:24 +08:00
|
|
|
/**
|
|
|
|
* Admin Panel
|
|
|
|
*/
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::group(['middleware' => 'App\Http\Middleware\CheckAdminMiddleware', 'prefix' => 'admin'], function()
|
2016-07-22 19:36:24 +08:00
|
|
|
{
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::get('/', 'AdminController@index');
|
2016-07-22 19:36:24 +08:00
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::any('/customize', 'AdminController@customize');
|
|
|
|
Route::any('/score', 'AdminController@score');
|
|
|
|
Route::any('/options', 'AdminController@options');
|
|
|
|
Route::any('/update', 'AdminController@update');
|
2016-07-22 19:36:24 +08:00
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::get('/users', 'AdminController@users');
|
|
|
|
Route::get('/players', 'AdminController@players');
|
2016-07-23 15:20:10 +08:00
|
|
|
// ajax handlers
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::post('/users', 'AdminController@userAjaxHandler');
|
|
|
|
Route::post('/players', 'AdminController@playerAjaxHandler');
|
2016-07-22 19:36:24 +08:00
|
|
|
});
|
|
|
|
|
2016-07-21 22:01:57 +08:00
|
|
|
/**
|
|
|
|
* Resources
|
|
|
|
*/
|
2016-08-28 10:05:21 +08:00
|
|
|
Route::group(['middleware' => 'App\Http\Middleware\CheckPlayerExistMiddleware'], function()
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2016-08-29 14:49:10 +08:00
|
|
|
// Json profile
|
|
|
|
Route::get('/{player_name}.json', 'TextureController@json');
|
2016-08-29 15:10:51 +08:00
|
|
|
Route::get('/{api}/{player_name}.json', 'TextureController@jsonWithApi')->where('api', 'usm|csl');
|
2016-08-29 14:49:10 +08:00
|
|
|
// Legacy links
|
|
|
|
Route::get('/skin/{player_name}.png', 'TextureController@skin');
|
2016-09-04 15:35:12 +08:00
|
|
|
Route::get('/skin/{model}/{pname}.png', 'TextureController@skinWithModel');
|
2016-08-29 14:49:10 +08:00
|
|
|
Route::get('/cape/{player_name}.png', 'TextureController@cape');
|
2016-07-21 22:01:57 +08:00
|
|
|
});
|
|
|
|
|
2016-08-28 20:33:35 +08:00
|
|
|
Route::get('/textures/{hash}', 'TextureController@texture');
|
|
|
|
Route::get('/{api}/textures/{hash}', 'TextureController@textureWithApi')->where('api', 'usm|csl');
|
2016-08-08 17:49:47 +08:00
|
|
|
|
2016-07-21 22:01:57 +08:00
|
|
|
Route::get('/avatar/{base64_email}.png', 'TextureController@avatar');
|
2016-08-29 14:49:10 +08:00
|
|
|
Route::get('/avatar/{size}/{base64_email}.png', 'TextureController@avatarWithSize');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2016-07-27 18:52:46 +08:00
|
|
|
Route::get('/raw/{tid}.png', 'TextureController@raw');
|
|
|
|
|
2016-07-21 22:01:57 +08:00
|
|
|
Route::get('/preview/{tid}.png', 'TextureController@preview');
|
|
|
|
Route::get('/preview/{size}/{tid}.png', 'TextureController@previewWithSize');
|