snowfire/Beautymail

Unresolvable dependency resolving [Parameter #0 [ <required> $settings ]]

ALudwig57 opened this issue · 3 comments

Hello,
I would like to install BeautyMail in my laravel 5.4 project.

I've installed it exactly like the instructions of the GitHub manual. I've updated the composer, but i've got the error when i try the test of the github manual : Illuminate \ Contracts \ Container \ BindingResolutionException
Unresolvable dependency resolving [Parameter #0 [ $settings ]] in class Snowfire\Beautymail\Beautymail

Could you help me please ? Thank you for your answer !

PS : publishing the provider should pop the beautymail.php file on the folder config, there isn't, and i don't know why

@0oerdnaxelao0 run php artisan config:cache and php artisan cache:clear. Should work fine after that.

For anyone who is still struggling with this, I found that it was an issue with the construction of Beautymail class in the example. It needs a 'settings' parameter to work.

Replace this line:

$beautymail = app()->make(Snowfire\Beautymail\Beautymail::class);

With this one:

$beautymail = app()->make(Snowfire\Beautymail\Beautymail::class, ['settings' => null]);

Make sure to include the service provider in your app.php config file. Without this, the binding will not resolve correctly.

You should not need to manually pass in the settings parameter if the service provider is registered correctly.