0

Here is the problem.

I started a dingo project and am using laravel-modules in it. Every module has its own routing files. Using the project in development environment, everything works fine.

But when I run php artisan config:cache, when a request comes to laravel, it return the response The version given was unknown or has no registered routes. As I see, the problem is dingo just check the default api.php and web.php files to find the route. But module routes are not stored in that files. I store them in Modules/module_name/route/api.php file (as laravel-modules suggested).

Any suggestion would be welcome.

Mohsen Saberi
  • 19
  • 1
  • 7
  • 0 I have the same probleme, I do the follow code in api.php of module, but i have the fowling error. RuntimeException : A version is required for an API group definition I beleave that problem is a required group, but I not have a solution – IgorHerson Aug 04 '21 at 14:13

1 Answers1

1

change api file of module with version param in group session like this:

$api = app('Dingo\Api\Routing\Router');
    
$api->group(['version' => 'v1'], function ($api) {
    ...
});
Majid Hajibaba
  • 3,105
  • 6
  • 23
  • 55
IgorHerson
  • 109
  • 1
  • 5