File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ composer require elegantly/laravel-seo
28
28
You can publish the config file with:
29
29
30
30
``` bash
31
- php artisan vendor:publish --tag=" laravel- seo-config"
31
+ php artisan vendor:publish --tag=" seo-config"
32
32
```
33
33
34
34
This is the content of the published config file:
Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ public function __construct(
31
31
public ?array $ schemas = null ,
32
32
public ?SeoTags $ customTags = null ,
33
33
) {
34
- $ this ->title = $ title ?? config ('seo.title ' ) ?? '' ;
34
+ $ this ->title = $ title ?? __ ( config ('seo.title ' ) ) ?? '' ;
35
35
$ this ->canonical = $ canonical ?? URL ::current ();
36
- $ this ->description = $ description ?? config ('seo.description ' );
36
+ $ this ->description = $ description ?? __ ( config ('seo.description ' ) );
37
37
$ this ->robots = $ robots ?? config ('seo.robots ' );
38
38
$ this ->sitemap = $ sitemap ?? config ('seo.sitemap ' );
39
39
$ this ->image = $ image ?? $ this ->getImageFromConfig ();
@@ -43,7 +43,9 @@ public function __construct(
43
43
public function getImageFromConfig (): ?Image
44
44
{
45
45
if ($ image = config ('seo.image ' )) {
46
- return new Image ($ image );
46
+ return new Image (
47
+ url: filter_var ($ image , FILTER_VALIDATE_URL ) ? $ image : asset ($ image )
48
+ );
47
49
}
48
50
49
51
return null ;
You can’t perform that action at this time.
0 commit comments