Skip to content

Commit

Permalink
allow to define image as string instead of array
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Sep 13, 2024
1 parent c68feed commit d081867
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/OpenGraph/OpenGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function default(

public static function getImageFromConfig(): ?Image
{
$url = config('seo.opengraph.image.url') ?? config('seo.defaults.image.url');
$url = config('seo.opengraph.image.url') ?? config('seo.defaults.image.url') ?? config('seo.defaults.image');

if ($url) {
return new Image(
Expand Down
2 changes: 1 addition & 1 deletion src/Schemas/WebPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function default(

public static function getImageFromConfig(): ?string
{
$url = config('seo.defaults.image.url');
$url = config('seo.defaults.image.url') ?? config('seo.defaults.image');

if ($url) {
return filter_var($url, FILTER_VALIDATE_URL) ? $url : asset($url);
Expand Down
2 changes: 1 addition & 1 deletion src/Twitter/Cards/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function toTags(): SeoTags

public static function getImageFromConfig(): ?Image
{
$url = config('seo.twitter.image.url') ?? config('seo.defaults.image.url');
$url = config('seo.twitter.image.url') ?? config('seo.defaults.image.url') ?? config('seo.defaults.image');

if ($url) {
return new Image(
Expand Down

0 comments on commit d081867

Please sign in to comment.