Bypass automatic case alterations for labels

Hi. I can't figure out how to bypass the case alterations that are happening for resource names. For example
public static ?string $label = 'VAT Invoices';
public static ?string $label = 'VAT Invoices';
is automatically changed to 'Vat Invoices'.
7 Replies
binaryfire
binaryfire11mo ago
Spaces are being automatically injected between letters for things like 'FAQ' too.
binaryfire
binaryfire11mo ago
Found it: https://github.com/filamentphp/filament/blob/c806a27f7eac00a4305b0187beba6d30d4312eb4/packages/panels/src/Resources/Resource.php#L737 So this works:
protected static ?string $navigationLabel = 'VAT Invoices';
protected static ?string $navigationLabel = 'VAT Invoices';
trovster
trovster11mo ago
That works for the navigation, but not the resource title.
binaryfire
binaryfire11mo ago
Yeah, I've changed it separately on each page by overriding getTitle, and have set $label, $breadcrumb and $navigationLabel in the resource.
trovster
trovster11mo ago
You don't need to override the getTitle() method, just set protected static ?string $title on the Manage Page. I have protected static ?string $modelLabel not $label on my resources. Aha
/**
* @deprecated Use `$modelLabel` instead.
*/
protected static ?string $label = null;

protected static ?string $modelLabel = null;
/**
* @deprecated Use `$modelLabel` instead.
*/
protected static ?string $label = null;

protected static ?string $modelLabel = null;
binaryfire
binaryfire11mo ago
Thanks. I think I was looking at the v2 docs for that
Want results from more Discord servers?
Add your server
More Posts
disable lazy loading when testingIs there a way to disable lazy loading relation managers and widgets in testing environment? I wantHow to use tailwind css inside the filament custom created page?I have configured tailwind css with laravel. Inside my welcome.blade.php tailwind classes working fiHow to prevent tags in TagInput from doubling when reordering items in RepeaterI have a TagInput inside a Repeater that gets auto populated based on existing data. Every time I reDatepicker Issuewhen using the dark theme that the month dropdown in the date picker is white text on a white backgrUsing Alpine.js inside the existing app with Filament tableHi, I have a Laravel application and am using Alpine and have a Filament Table installed inside the Curator plugin acceptedFileTypes argument not being adhered to when picking from uploaded contentHi. Is anyone else using the curator plugin and also having this issue? https://github.com/awcodes/fInserting pivot data without RelationManagerI have a multiple select on an edit page, has a `belongsToMany()` relationship. I want to inject sohow can I create a custom page in filament, outside of the dashboard auth?for use of user invitation system, something with a layout like the register page, without filament Using Filament V3 packages outside Filament context (public page) with Vite bundleHey everyone! I'm trying to use Form builder in a public page, and I have a Vite bundle with JS compFilter by rangeHi, I'm trying to add a filter which filters a numeric value by range. I've given a room size of `24