File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 99use Illuminate \Console \Command ;
1010use Illuminate \Notifications \DatabaseNotification ;
1111use Illuminate \Support \Facades \Mail ;
12+ use Illuminate \Support \Facades \URL ;
13+ use Illuminate \Support \Str ;
1214
1315class PhotosAddedNotification extends Command
1416{
@@ -59,6 +61,12 @@ public function handle(): int
5961
6062 $ thumbUrl = $ photo ->size_variants ->getThumb ()?->url;
6163
64+ // Mail clients do not like relative paths.
65+ // if url does not start with 'http', it is not absolute...
66+ if (!Str::startsWith ('http ' , $ thumbUrl )) {
67+ $ thumbUrl = URL ::asset ($ thumbUrl );
68+ }
69+
6270 // If the url config doesn't contain a trailing slash then add it
6371 if (str_ends_with (config ('app.url ' ), '/ ' )) {
6472 $ trailing_slash = '' ;
Original file line number Diff line number Diff line change 2121use Illuminate \Database \Eloquent \Model ;
2222use Illuminate \Database \Eloquent \Relations \BelongsTo ;
2323use Illuminate \Support \Facades \Auth ;
24+ use Illuminate \Support \Facades \URL ;
2425use League \Flysystem \Local \LocalFilesystemAdapter ;
2526
2627// TODO: Uncomment the following line, if Lychee really starts to support AWS s3.
You can’t perform that action at this time.
0 commit comments