api: Routes not being registered

Hello,

Just installed a fresh Laravel 5.1 application, proceeded to pull in this package and all is well.

{
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "dingo/api": "0.10.*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

Obviously, removed the other irrelevant stuff to show I have this set up correctly.

Registered the service provider in config/app.php for Laravel

Dingo\Api\Provider\LaravelServiceProvider::class

Published the config file, again for Laravel (config/app.php)

php artisan vendor:publish --provider="Dingo\Api\Provider\LaravelServiceProvider"

Now, for the routes (app\Http\routes.php)

$api = app('Dingo\Api\Routing\Router');

$api->version('v1', ['namespace' => 'InkedFemales\Http\Controllers'], function ($api) {

    $api->resource('photos', 'PhotosController');

});

As far as I’m aware, this is correct. If my namespacing was incorrect, I know it throws a ReflectionException when running php artisan - which I also tested by misspelling controller and it did exactly that (throwing the exception).

But this is my problem, when running php artisan api:routes I just get

Your application doesn’t have any routes.

Why is this? Am I missing something?

Really appreciate what you have done with this package so far!

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 22 (6 by maintainers)

Most upvoted comments

@punit006 see #1165

Someone has submitted a PR for a fix. #1152

@punit006 Do you have an API_PREFIX or API_DOMAIN setup in your .env file?