]> git.localhorst.tv Git - alttp.git/blob - routes/api.php
try to respond more appropriately
[alttp.git] / routes / api.php
1 <?php
2
3 use Illuminate\Http\Request;
4 use Illuminate\Support\Facades\Route;
5
6 /*
7 |--------------------------------------------------------------------------
8 | API Routes
9 |--------------------------------------------------------------------------
10 |
11 | Here is where you can register API routes for your application. These
12 | routes are loaded by the RouteServiceProvider within a group which
13 | is assigned the "api" middleware group. Enjoy building your API!
14 |
15 */
16
17 Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
18         return $request->user()->load(['channel_crews', 'channel_crews.channel']);
19 });
20
21 Route::get('alttp-seed/{hash}', 'App\Http\Controllers\AlttpSeedController@byHash');
22 Route::post('alttp-seed/{hash}/retry', 'App\Http\Controllers\AlttpSeedController@retry');
23
24 Route::post('application/{application}/accept', 'App\Http\Controllers\ApplicationController@accept');
25 Route::post('application/{application}/reject', 'App\Http\Controllers\ApplicationController@reject');
26
27 Route::get('channels', 'App\Http\Controllers\ChannelController@search');
28 Route::get('channels/{channel}', 'App\Http\Controllers\ChannelController@single');
29 Route::post('channels/{channel}/chat', 'App\Http\Controllers\ChannelController@chat');
30 Route::get('channels/{channel}/chat-bot-log', 'App\Http\Controllers\ChannelController@chatBotLog');
31 Route::post('channels/{channel}/chat-settings', 'App\Http\Controllers\ChannelController@chatSettings');
32 Route::post('channels/{channel}/join', 'App\Http\Controllers\ChannelController@join');
33 Route::post('channels/{channel}/part', 'App\Http\Controllers\ChannelController@part');
34 Route::delete('channels/{channel}/commands/{command}', 'App\Http\Controllers\ChannelController@deleteCommand');
35 Route::put('channels/{channel}/commands/{command}', 'App\Http\Controllers\ChannelController@saveCommand');
36 Route::get('channels/{channel}/guessing-game/{name}', 'App\Http\Controllers\ChannelController@getGuessingGame');
37 Route::post('channels/{channel}/guessing-game/{name}', 'App\Http\Controllers\ChannelController@controlGuessingGame');
38 Route::put('channels/{channel}/guessing-game/{name}', 'App\Http\Controllers\ChannelController@saveGuessingGame');
39
40 Route::get('guessing-game-monitor/{key}', 'App\Http\Controllers\ChannelController@getGuessingGameMonitor');
41
42 Route::get('content', 'App\Http\Controllers\TechniqueController@search');
43 Route::get('content/{tech:name}', 'App\Http\Controllers\TechniqueController@single');
44 Route::put('content/{content}', 'App\Http\Controllers\TechniqueController@update');
45
46 Route::get('discord-channels/{channel_id}', 'App\Http\Controllers\DiscordChannelController@single');
47
48 Route::get('discord-guilds', 'App\Http\Controllers\DiscordGuildController@search');
49 Route::get('discord-guilds/{guild_id}', 'App\Http\Controllers\DiscordGuildController@single');
50 Route::get('discord-guilds/{guild_id}/channels', 'App\Http\Controllers\DiscordChannelController@search');
51
52 Route::get('episodes', 'App\Http\Controllers\EpisodeController@search');
53 Route::post('episodes/{episode}/add-restream', 'App\Http\Controllers\EpisodeController@addRestream');
54 Route::post('episodes/{episode}/crew-manage', 'App\Http\Controllers\EpisodeController@crewManage');
55 Route::post('episodes/{episode}/crew-signup', 'App\Http\Controllers\EpisodeController@crewSignup');
56 Route::post('episodes/{episode}/edit-restream', 'App\Http\Controllers\EpisodeController@editRestream');
57 Route::post('episodes/{episode}/remove-restream', 'App\Http\Controllers\EpisodeController@removeRestream');
58
59 Route::get('events', 'App\Http\Controllers\EventController@search');
60 Route::get('events/{event:name}', 'App\Http\Controllers\EventController@single');
61
62 Route::get('markers/{map}', 'App\Http\Controllers\TechniqueController@forMap');
63
64 Route::get('pages/{type}', 'App\Http\Controllers\TechniqueController@byType');
65 Route::get('pages/{type}/{name}', 'App\Http\Controllers\TechniqueController@byTypeAndName');
66
67 Route::get('protocol/{tournament}', 'App\Http\Controllers\ProtocolController@forTournament');
68
69 Route::post('results', 'App\Http\Controllers\ResultController@create');
70
71 Route::post('rounds', 'App\Http\Controllers\RoundController@create');
72 Route::put('rounds/{round}', 'App\Http\Controllers\RoundController@update');
73 Route::post('rounds/{round}/lock', 'App\Http\Controllers\RoundController@lock');
74 Route::post('rounds/{round}/setSeed', 'App\Http\Controllers\RoundController@setSeed');
75 Route::post('rounds/{round}/unlock', 'App\Http\Controllers\RoundController@unlock');
76
77 Route::get('tech', 'App\Http\Controllers\TechniqueController@search');
78 Route::get('tech/{tech:name}', 'App\Http\Controllers\TechniqueController@single');
79
80 Route::get('tournaments/{id}', 'App\Http\Controllers\TournamentController@single');
81 Route::get('tournaments/{tournament}/more-rounds', 'App\Http\Controllers\TournamentController@moreRounds');
82 Route::post('tournaments/{tournament}/apply', 'App\Http\Controllers\TournamentController@apply');
83 Route::post('tournaments/{tournament}/close', 'App\Http\Controllers\TournamentController@close');
84 Route::post('tournaments/{tournament}/discord', 'App\Http\Controllers\TournamentController@discord');
85 Route::post('tournaments/{tournament}/discord-settings', 'App\Http\Controllers\TournamentController@discordSettings');
86 Route::post('tournaments/{tournament}/lock', 'App\Http\Controllers\TournamentController@lock');
87 Route::post('tournaments/{tournament}/open', 'App\Http\Controllers\TournamentController@open');
88 Route::post('tournaments/{tournament}/settings', 'App\Http\Controllers\TournamentController@settings');
89 Route::post('tournaments/{tournament}/unlock', 'App\Http\Controllers\TournamentController@unlock');
90
91 Route::get('users', 'App\Http\Controllers\UserController@search');
92 Route::get('users/{id}', 'App\Http\Controllers\UserController@single');
93 Route::post('users/set-language', 'App\Http\Controllers\UserController@setLanguage');
94 Route::post('users/{user}/setNickname', 'App\Http\Controllers\UserController@setNickname');
95 Route::post('users/{user}/setStreamLink', 'App\Http\Controllers\UserController@setStreamLink');