1
我已經更新get方法的代碼如下,在swagger中正常工作 。Laravel(發佈,刪除,放)路線在Swagger
任何人都可以給我推薦用於發佈,放置,刪除它的laravel路徑,控制器代碼的swagger代碼。 (正如我提到遵循GET)
路線/ web.php
Route::group(['prefix' => 'api/'], function() {
Route::get('dashboard', '[email protected]');
});
DashboardController.php
* Display a listing of the resource.
*
* @return \Illuminate\Http\JsonResponse
*
* @SWG\Get(
* path="/api/dashboard",
* description="Returns dashboard overview.",
* operationId="api.dashboard.index",
* produces={"application/json"},
* tags={"dashboard"},
* @SWG\Response(
* response=200,
* description="Dashboard overview."
* ),
* @SWG\Response(
* response=401,
* description="Unauthorized action.",
* )
*)
*/
public function index(Request $request)
{
return response()->json([
'result' => [
'statistics' => [
'users' => [
'name' => 'Name',
'email' => '[email protected]'
]
],
],
'message' => '',
'type' => 'success',
'status' => 0
]);
}
謝謝,我會檢查這個 – Arvind
好的,如果你有任何困惑,你可以告訴我。謝謝 –
雅肯定,我會 – Arvind