Gaspar
decimal value has inconsistencies/bugs in Column and Textinput
Bumped to very weird Filament "bug" today.
Did some research in docs, Git, and here and found nothing.
1. have field
price
in database (MySQL): price` double(20,4)
2. have value in this field: 5.9400
3. Filament Table (Tables\Columns\TextColumn::make('price')
) shows: 5.94
(should be 5.9400
)
4. Filament Form (Components\TextInput::make('price')
) shows: 5.9399999999999995
(should be 5.9400
)
I very much prefer Filament not changing values stored in database 🙂
Any ideas what is going on and can i "fix" it?5 replies
How can i catch Filament Import Action errors
I'm using Filament Import Action https://filamentphp.com/docs/3.x/actions/prebuilt-actions/import
There is a table called
failed_import_rows
and it has row data
and field validation_error
.
But there are no validation errors so i have no glue why are some rows not imported.
How can i catch/save errors occuring in row import?3 replies
Custom theme - Tailwind class not included in built css
Made custom theme and required steps but my added Tailwind class is not in CSS.
For testing i added Tailwind class
text-ellipsis
to app/Filament/Resources/ProductResource.php
1. Made custom theme:
2. Added new item in vite.config.js
3. Added viteTheme()
to Admin-panel
4. Executed build command
Why the tailwind.config.js
warning here?
The Filament command created this file @ resources/css/filament/admin/tailwind.config.js
:
Am i missing something here?5 replies
Hide table columns sorting ability then Grouping
If using Grouping then table sorting is not working. Only Grouping sorting. It is kind of bug 😦
To overcome this i would like to hide columns sorting ability then Grouping.
Is there any get method for quering table Grouping?
2 replies
change Infolists\Components\TextEntry content class
Currently the TextEntry component has child element with class:
This changes all elements into inline elements.
I would like to avoid that and change the classname into to display content in full width!
Is it possible to "override" it or should i make my own component?
7 replies
how to scope count in multi-tenancy?
I use
tenant
in my panel. It scopes records by user. Logic is in ApplyTenantScopes::class
. And it works correctly.
However is also use count()
in Resource getNavigationBadge()
:
That is not scoped anymore (it counts all records).
How to resolve this?
Should i put double logic in my Model also?
Or i can use ApplyTenantScopes::class
(logic) in here somehow?2 replies
Table builder > Tailwind CSS > darkMode: 'class' not working
Installed Tailwind CSS based on this:
https://filamentphp.com/docs/3.x/tables/installation#installing-tailwind-css
In the
tailwind.config.preset
there is darkMode "mode" defined:
Basically it means i can control dark/lightMode with classname.
But it doesn't work 😦
My Filament Table has still MEDIA query attached:
How do you resolve it?1 replies
Reordable pivot table in Relation Manager
I have 3 tables:
* categories (id, name)
* attributes (id, name)
* attribute_category (category_id, attribute_id, order) - pivot table
I have AttributesRelationManager in Category Edit page:
It shows category attributes nicely, ordered by
order
field in attribute_category
But then i try to reorder those displayed attributes, it generates DB error:
What am i missing here?2 replies
How to show FilamentIcon inside Placeholder
This example selects correct "icon class" (instead of icon itself).
I would like to show FilamentIcon instead.
Could not find example how to do it:
https://filamentphp.com/docs/3.x/support/icons
4 replies
SelectFilter - can i provide my own value + label / remove the default option
SelectFilter always populates option without value and default label "All":
<option>All</option>
How can i provide my own value and label for it?
Or second option - remove it altogether?6 replies
Use LocaleSwitcher in userMenuItems
I have multilanguage content.
Currently i loop over all my allowed locales and display standard links in userMenuItems. It gets pretty long (not the best UI/UX experience).
I would like to use SpatieLaravelTranslatablePlugin widget (Livewire) LocaleSwitcher in AdminPanel userMenuItems to switch app locale rather to put this Widget in every Resource page and duplicate code.
There is Theme Switcher working in user menu already.
Is it doable to inject other Livewire widgets?
2 replies
Best way to format data in the table
1. data is stored in DB, for example: 0.40 (as money) and quantity 1234.56 (as float)
2. i would like to display localized data, for example: €0,40 (as money in EUR) and quantity 1 234.56 (as set in selected locale)
I made a test for money column:
Tables\Columns\TextColumn::make('price')->money('eur')
But this displays incorrect value as "€4,00" (it should be €0,40).
Q1: What's wrong here?
And i see no ->number()
type (as in Filament Form component).
Q2: What is the best way to do it in Filament Table component?
Should i customise every column with my own implementation ->formatStateUsing()
?29 replies
Changing the maximum content width is not working?
According to docs i should be able to change content maximum width, right?!
Tried both.
1. in
config/filament.php
i entered
My resource page html still contains max-w-7xl
2. in my resource page i entered
protected ?string $maxContentWidth = 'full';
My resource page html still contains max-w-7xl
What i'm missing here?12 replies