4
4
5
5
/*
6
6
|--------------------------------------------------------------------------
7
- | Our Main Api Domain if We use api.domain.com
8
- | Avoid Showing the Default Site Content
7
+ | To Use api.domain.com
8
+ | Make Sure to Add it on .env
9
+ | API_DOMAIN= and replace the API_PREFIX
9
10
|--------------------------------------------------------------------------
10
11
|
11
12
*/
12
13
13
- // $api->version('v1', function ($api) {
14
- // $api->get('/', ['as' => 'api.index', 'uses' => 'Api\DomainController@index']);
15
- // });
14
+ $ api ->version ('v1 ' , function ($ api ) {
16
15
17
16
/*
18
17
|--------------------------------------------------------------------------
51
50
|--------------------------------------------------------------------------
52
51
|
53
52
*/
54
- $ api -> version ( ' v1 ' , function ( $ api ) {
53
+
55
54
$ api ->group (['prefix ' => 'auth ' ], function ($ api ) {
56
55
// Working Tested , We Added check in exception in guest middleware for Unwated Behaviour
57
56
$ api ->post ('check ' , 'Api\V1\Auth\Controllers\LoginController@check ' );
79
78
$ api ->version ('v1 ' , function ($ api ) {
80
79
$ api ->get ('/users ' , ['as ' => 'api.index ' , 'uses ' => 'Api\V1\Users\Controllers\UsersController@index ' ]);
81
80
$ api ->get ('/user/{id} ' , ['as ' => 'api.index ' , 'uses ' => 'Api\V1\Users\Controllers\UsersController@show ' ]);
81
+ });
82
+
83
+ /*
84
+ |--------------------------------------------------------------------------
85
+ | Wildcard Default Response in Api Routes
86
+ |--------------------------------------------------------------------------
87
+ |
88
+ */
89
+ $ api ->version ('v1 ' , function ($ api ) {
90
+ $ api ->get ('/{wildcard?} ' , ['as ' => 'api.index ' , 'uses ' => 'Api\DomainController@index ' ])->where ('wildcard ' , '[\/\w\.-]* ' )->name ('app ' );
82
91
});
0 commit comments