When running:
app('Dingo\Api\Routing\UrlGenerator')->version('v1')->route('route.alias', ['parameter'])
I get the following error
Error : Call to undefined method Dingo\Api\Routing\Route::getDomain()
Maybe it is necessary to update the current Routing/Route.php domain() method? To something like what exists in Illuminate/Routing/Route.php:
/**
* Get or set the domain for the route.
*
* @param string|null $domain
* @return $this|string|null
*/
public function domain($domain = null)
{
if (is_null($domain)) {
return $this->getDomain();
}
$this->action['domain'] = $domain;
return $this;
}
Actual Behaviour
When running:
app('Dingo\Api\Routing\UrlGenerator')->version('v1')->route('route.alias', ['parameter'])
I get the following errorError : Call to undefined method Dingo\Api\Routing\Route::getDomain()
Expected Behaviour
The route must be correctly generated.
Steps to Reproduce
config/app.php:
app/Providers/RouteServiceProvider.php:
routes/api.php:
Possible Solutions
https://github.com/laravel/framework/blob/5.5/src/Illuminate/Routing/RouteUrlGenerator.php version is different from previous ones. it is since 5.5 that getDomain() was introduced.
Maybe it is necessary to update the current Routing/Route.php domain() method? To something like what exists in Illuminate/Routing/Route.php: