beyondcode / helo-laravel

HELO Laravel helper package to add
MIT License
88 stars 25 forks source link

Helper package can't be installed when using laravels "global to address" feature. #43

Closed eugen-stranz closed 8 months ago

eugen-stranz commented 1 year ago

Hello there,

we just discovered a strange bug.

Your composer package can't be installed if you use the "Global to address" Feature of Laravel.

public function boot(): void
{
    if ($this->app->environment('local')) {
        Mail::alwaysTo('taylor@example.com');
    }
}

Once you remove those lines it works. We had this issue in our project and first we thaught that something else might trigger this behaviour.

But we went the extra mile and created a new laravel project with nothing in there - we added those lines into the AppServiceprovider and then we tried to install the helper package and it doesn't work.

You get the following error:

Screenshot 2023-06-17 at 7 44 24 PM
mechelon commented 8 months ago

I could not reproduce this behaviour with Laravel 10 or 11. Mail::alwaysTo works as expected with HELO. Feel free to reopen if you can provide more information about this problem, e.g. a detailed composer.json file.