From a8538e3fcfb6d734275d3423ec00981738d1e483 Mon Sep 17 00:00:00 2001 From: Kath Young Date: Thu, 7 Mar 2024 13:04:50 +1030 Subject: [PATCH] And from plurals --- src/Filament/Resources/AbstractResource.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Filament/Resources/AbstractResource.php b/src/Filament/Resources/AbstractResource.php index c87ca498..603f5f00 100644 --- a/src/Filament/Resources/AbstractResource.php +++ b/src/Filament/Resources/AbstractResource.php @@ -15,4 +15,13 @@ public static function getTitleCaseModelLabel(): string return Str::title(static::getModelLabel()); } + + public static function getTitleCasePluralModelLabel(): string + { + if (! static::hasTitleCaseModelLabel()) { + return static::getPluralModelLabel(); + } + + return Str::title(static::getPluralModelLabel()); + } }