Skip to content

Published configuration and artisan command to create server does not play well together #3

Closed
@jelhan

Description

@jelhan

Published configuration includes a default server named v1:

'servers' => [
'v1' => \App\JsonApi\V1\Server::class,
],

But publishing the configuration does not create required files for that server. \App\JsonApi\V1\Server does not exist.

Artisan command to create the server fails because the server is already registered:

$ php artisan jsonapi:server v1
Server v1 is already registered in your JSON:API configuration.

Must remove the server registration in config/jsonapi.php before creating the required files with artisan command.

jsonapi:server artisan command does not register the created server in config/jsonapi.php. Registration deleted before running the command must be added again manually after running it.

Steps to reproduce

  1. Create a new laravel project with composer installer
    composer create-project laravel/laravel example-app
    cd example-app
  2. Install laravel-json-api/laravel (tested with v1.0.0-alpha.1)
    composer config minimum-stability alpha
    composer require laravel-json-api/laravel
    composer require --dev laravel-json-api/testing
  3. Publish configuration
    php artisan vendor:publish --provider="LaravelJsonApi\Laravel\ServiceProvider"
  4. Try to create server
    php artisan jsonapi:server v1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions