heesel

Illuminate\Contracts\Container\BindingResolutionException: Unresolvable dependency resolving [Parameter #0 [ <required> $user ]] in class App\Mail\ThanksForSubmittingMail

laravel Icon

Illuminate\Contracts\Container\BindingResolutionException

Unresolvable dependency resolving [Parameter #0 [ <required> $user ]] in class App\Mail\ThanksForSubmittingMail

An unhandled exception occurred on line 1064
1061
    {
1062
        $message = "Unresolvable dependency resolving [$parameter] in class {$parameter->getDeclaringClass()->getName()}";
1063
1064
        throw new BindingResolutionException($message);
1065
    }

Solution

my constructor did not contain my user model. i had the following:
public function __construct($user)
    {
        $this->user = $user;
    }

and changed it to:
  public function __construct(User $user)
    {
        $this->user = $user;
    }
That fixed it for me            
Apr 06, 2021 Anyone

0 replies


Install the browser extension

Found this solution helpful? Try our extension for quick solutions to your Laravel errors.

Chrome logo Add to Chrome - It's free