Having problem that occurs when Doing a Password reset . I think that problem is with this line of code:
if (! function_exists('url')) {
/**
* Generate a url for the application.
*
* @param string $path
* @param mixed $parameters
* @param bool $secure
* @return string
*/
function url($path = null, $parameters = [], $secure = null)
{
return (new Laravel\Lumen\Routing\UrlGenerator(app()))
->to($path, $parameters, $secure);
}
This line of code:
$response = Password::broker($broker)->sendResetLink($request->only('email'), function (Message $message) {
$message->subject('Your Password Reset Link');
});
Returns:
Target [Illuminate\Contracts\Routing\UrlGenerator] is not instantiable
In AppServiceProvider i've added:
$this->app->singleton('Illuminate\Contracts\Routing\ResponseFactory', function ($app)
{
return new ResponseFactory($app['Illuminate\Contracts\View\Factory'], $app['Illuminate\Routing\Redirector']);
});
Add this to your service provider:
$this->app->bind(\Illuminate\Contracts\Routing\UrlGenerator::class, function ($app) {
return new \Laravel\Lumen\Routing\UrlGenerator($app);
});
Your UrlGenerator contract has not been bound to any instance, so you'll have to do it manually.
This solved the issue, thank you.
Well, it seems this is outdated and \Laravel\Lumen\Routing\UrlGenerator does not follow the \Illuminate\Contracts\Routing\UrlGenerator. It lacks setRootControllerNamespace in particular.
Most helpful comment
Add this to your service provider:
Your
UrlGeneratorcontract has not been bound to any instance, so you'll have to do it manually.