Hello everyone, I need to understand why registering the binding substitution middleware at the API Group level while declaring the routes works, whereas if I register and declare it inside the Dingo configuration file it doesn't work.
It works:
> routes/api.php
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function ($api) {
$api->group(['middleware' => \Illuminate\Routing\Middleware\SubstituteBindings::class], function($api) {
$api->resource('countries', 'App\Http\Controllers\Api\CountryController');
});
});
Doesn't work:
> config/api.php
/*
|--------------------------------------------------------------------------
| API Middleware
|--------------------------------------------------------------------------
|
| Middleware that will be applied globally to all API requests.
|
*/
'middleware' => [
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
Hello everyone, I need to understand why registering the binding substitution middleware at the API Group level while declaring the routes works, whereas if I register and declare it inside the Dingo configuration file it doesn't work.
It works:
Doesn't work: