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?)?
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#L31In 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 thefile_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?)?