Search code examples
phplaraveldingo-api

Registering Dingo route


I'm bit confused. Where do I register the router? Inside routes/api.php? Or elsewhere?

To avoid complications with your main application routes this package utilizes its own router. As such we must first get an instance of the API router to create our endpoints.

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

Source: Dingo documentation


Solution

  • After some elaboration routes/api.php is the right place