-
Notifications
You must be signed in to change notification settings - Fork 2
/
api.php
45 lines (38 loc) · 1.7 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
<?php
use Illuminate\Http\Request;
use App\Http\Controllers\CommentController;
use App\Http\Controllers\TaskController;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
/*==========Search API Route==========*/
Route::get("spot/random/", "TaskController@spotRandom");
Route::get("spot/", "TaskController@spotIndex");
Route::get("spot/search/", "TaskController@spotSearch");
Route::get("spot/{id}", "TaskController@spotInfo");
Route::get("shop/random/", "TaskController@shopRandom");
Route::get("shop/", "TaskController@shopIndex");
Route::get("shop/search/","TaskController@shopSearch");
Route::get("shop/{id}", "TaskController@shopInfo");
Route::get("keyword/{keyword}","TaskController@keywordSearch");
/*==========Search API Route end==========*/
/*==========Article API Route==========*/
Route::get("article/","TaskController@articleIndex");
Route::get("article/random/", "TaskController@articleRandom");
Route::get("article/category/{category}","TaskController@articleCategory");
Route::get("article/{id}","TaskController@articleInfo");
/*==========Article API Route end==========*/
/*==========comment API Route ==========*/
Route::post("comment/", "CommentController@create");
Route::delete("comment/{id}", "CommentController@destroy");
/*==========comment API Route ==========*/
Route::fallback(function(){
return response()->json(['message' => 'Not Found!', 'code' => 404], 404);
});