Skip to content

Commit

Permalink
Attempt model label as fallback before using original parent method
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-alrek committed Jan 16, 2024
1 parent 864c994 commit 87f0fd3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Concerns/HasLocalizableResourceLabels.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,23 @@ public static function getNavigationLabel(): string
{
return static::translatedLabel(
label: static::NAVIGATION_LABEL,
fallback: parent::getNavigationLabel(),
fallback: static::translatedLabel(
label: static::MODEL_LABEL,
fallback: parent::getSlug(),
plural: true
)
);
}

public static function getSlug(): string
{
return static::translatedLabel(
label: static::SLUG,
fallback: parent::getSlug(),
fallback: static::translatedLabel(
label: static::MODEL_LABEL,
fallback: parent::getSlug(),
plural: true
)
);
}
}

0 comments on commit 87f0fd3

Please sign in to comment.