First, let’s see what we are going to have in this article:
Brief introduction about Swagger and its Importance.
Install and configure Laravel wi...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for this. Have been using swagger in Symfony. This is a nice introduction into laravel.
I have found some errors in the router
Route::post('v1/user-login', 'API\ V1\AuthController@login');
should be without a space:
Route::post('v1/user-login', 'API\V1\AuthController@login');
Further you introduced the namespace
App\Http\Controllers\API\Mobile\V1
but reference to it without the Mobile part.Lastly, my default laravel doesn't seem to have a field
mobile_number
in it.It is a good tutorial, but I would add that it is necessary to add the ui for login.
I fixed it after running the following commands and comment this line
'title' => 'Integration Swagger in Laravel with Passport Auth',
composer require laravel/ui
// Generate basic scaffolding...(any of these)
php artisan ui bootstrap
php artisan ui vue
php artisan ui react
// Generate login / registration scaffolding...(any of these)
php artisan ui bootstrap --auth
php artisan ui vue --auth
php artisan ui react --auth
npm install
npm run dev
I am using swagger(8.0) with Laravel(8.40). Everything is fine but not able to create dynamic url for the swagger documentation. It always create documentation with 127.0.0.1:8000/api/docs. I want dynamic host so that I can also share this documentation with others after upload my project on the live server.
instead of using passport i want to use my jwt token in header but i want user to add email / password in auth modal and the token should automatically set to header,
we do not want user to copy and paste the token in auth modal manually, when using apiKey securitySchemes
is that possible to achieve
dev-to-uploads.s3.amazonaws.com/up...
dev-to-uploads.s3.amazonaws.com/up...
refer 2nd screenshot i want to set token automatically here
or if possible provide email / password input and after response add that into header
why are you sending form data as query parameter in POST request
I asked the same question to myself. I'm now looking for how to move it to the request body. Have you find out?
You can achieve from the following example
Thank you buddy!!
Not working for Laravel 8
Sweet, you can do for Laravel Sanctum next.
in laravel 8 getting on thi command
php artisan l5-swagger: generate
L5Swagger\Exceptions\L5SwaggerException
Documentation config not found
please help |
Halo, I have read your article..
but I have a problem because Authorize Button is not showing, how to fix that issue?
Awesome!
Is there a plugin or an extension i can use to write these annotation quicker with vscode editor?
Guys I couldn't authorize, Where could i find username and password
after following the steps i run
composer require "darkaonline/l5-swagger"
i am getting this error,
Call to undefined method Laravel\Passport\Passport::routes()
i am following step by step.