api: Laravel 5 Controller not found

When using this code I get reflection error Controller now found. Any idea how to resolve this issue ? I am using Laravel 5.1. All the code below is under routes.php

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

$api->version('v1',function($api)
{
    $api->get('hello','HelloController@show');
});

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

You’ve most likely got something mis-configured. I just fired up a fresh Laravel 5.1 install with the package that’s using a controller in the default namespace and it works fine. I can see the correct response at /api/hello and using php artisan api:routes lists it correctly.

Make sure you double and triple check the spelling on everything. Make sure your namespace for your controller is correct and is being autoloaded properly. Make sure your route references the controller correctly including the namespace.