-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.php
47 lines (38 loc) · 1.6 KB
/
api.php
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
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route;
// use App\Http\Controllers\SiteController;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
*/
Route::get('version', function () {
return response()->json(['version' => config('app.version')]);
});
Route::middleware('auth:api')->get('/user', function (Request $request) {
Log::debug('User:' . serialize($request->user()));
return $request->user();
});
Route::namespace('App\\Http\\Controllers\\API\V1')->group(function () {
Route::get('profile', 'ProfileController@profile');
Route::put('profile', 'ProfileController@updateProfile');
Route::post('change-password', 'ProfileController@changePassword');
Route::get('tag/list', 'TagController@list');
Route::get('category/list', 'CategoryController@list');
Route::get('site/list', 'SiteController@list');
Route::get('complain/list', 'ComplaintController@list');
Route::post('product/upload', 'ProductController@upload');
Route::get('all-complaints', 'DashboadController@AllComplaints');
Route::get('open-complaints', 'DashboadController@OpenComplaints');
Route::get('closed-complaints', 'DashboadController@ClosedComplaints');
Route::apiResources([
'user' => 'UserController',
'product' => 'ProductController',
'category' => 'CategoryController',
'site' => 'SiteController',
'complain' => 'ComplaintController',
'tag' => 'TagController',
]);
});