aboutsummaryrefslogtreecommitdiff
path: root/src/routes.php
blob: 027603c68dc0edd8197ba9c831a9d0eef79cb450 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
Route::group(array('https'), function() {

    Route::api(['version' => 'v1', 'protected' => false], function () {
        
        Route::get('user/login', 'CamilStaps\BotleaguesApi\UserController@login');
        Route::resource('bot', 'CamilStaps\BotleaguesApi\BotController',
            ['only' => ['index','show']]);
        
        Route::resource('competition', 'CamilStaps\BotleaguesApi\CompetitionController',
            ['only' => ['index','show']]);
        
        Route::resource('competition_type', 'CamilStaps\BotleaguesApi\CompetitionTypeController',
            ['only' => ['index','show']]);
        
        Route::resource('game', 'CamilStaps\BotleaguesApi\GameController',
            ['only' => ['index','show']]);
        
        Route::resource('participant', 'CamilStaps\BotleaguesApi\ParticipantController',
            ['only' => ['index','show']]);
        
        Route::resource('user', 'CamilStaps\BotleaguesApi\UserController',
            ['only' => ['index','show','store']]);

    });

    Route::api(['version' => 'v1', 'protected' => true, 'providers' => 'basic'], function () {
        
        Route::resource('bot', 'CamilStaps\BotleaguesApi\BotController',
            ['except' => ['index', 'show', 'create','edit']]);

        Route::resource('user', 'CamilStaps\BotleaguesApi\UserController',
            ['except' => ['index', 'show', 'create','edit','store']]);

        Route::group(array('before' => 'administrator'), function() {
        
            Route::resource('competition', 'CamilStaps\BotleaguesApi\CompetitionController',
                ['except' => ['index', 'show', 'create', 'edit']]);
            
            Route::resource('competition_type', 'CamilStaps\BotleaguesApi\CompetitionTypeController',
                ['except' => ['index', 'show', 'create', 'edit']]);
            
            Route::resource('game', 'CamilStaps\BotleaguesApi\GameController',
                ['except' => ['index', 'show', 'create','edit']]);

        });

    });

});