eduardokum / laravel-mail-auto-embed

MIT License
166 stars 36 forks source link

Does not work in homestead environments #4

Closed darthtaco closed 6 years ago

darthtaco commented 7 years ago

This package doesn't appear to work in Homestead. I believe the culprit is the use of the url('/') function here: https://github.com/eduardokum/laravel-mail-auto-embed/blob/918c3aff220d965fbaee96ae4d48a09036381bdf/src/Embedder/AttachmentEmbedder.php#L31

In Homestead, the url() method returns 'http://localhost' which is not generally the same url used when developing on a host system. Therefore, the local file path is not properly replaced, and the file_exists() method on the next line fails.

This begs the question of why the package should be so strict as to require the image it is embedding exist on the same server as where the code is running. Shouldn't any URL be acceptable to embed (maybe a configuration option?)?

eduardokum commented 7 years ago

I understand your point. Could not use the url path, but relative?