rxcod9 / joy-voyager-api

Joy VoyagerApi module adds REST Api end points to Voyager with Passport and Swagger support.
https://joy-voyager.kodmonk.com
MIT License
19 stars 4 forks source link

auth guard [api] is not defined #16

Closed lamualfa closed 2 years ago

lamualfa commented 2 years ago

spesification


step to reproduce

you can clone this repo lamualfa/joy-voyager-api-issue or follow the steps below from the scratch:

create laravel template

composer create-project laravel/laravel joy-voyager-api-issue

navigate to project folder

cd joy-voyager-api-issue

install vendor

composer install

generate laravel key

php artisan key:generate

install voyager

composer require joy/voyager-api

install voyager dummy data

php artisan voyager:install --with-dummy

install joy-voyager-api

composer require joy/voyager-api

publish provider

php artisan vendor:publish --provider="Joy\VoyagerApi\VoyagerApiServiceProvider" --force

generate api documentation

php artisan joy-voyager-api:l5-swagger:generate

run the laravel server

php artisan serve

access the api

http://localhost:8000/api/menus

and you'll get the error below:

image

rxcod9 commented 2 years ago

Your “install voyager” step is wrong

As joy voyager-api-auth is added in dependency, you’ll need to setup passport as well

lamualfa commented 2 years ago

@rxcod9 thanks.