rominronin
How mature do you see the filament project?
Background: We are currently upgrading from v2 to v3, we welcome the new features, but it's proving to be more time consuming than we anticipated.
This got us thinking about v3 to v4. I want to get a discussion going (rather than expecting an impossible answer) about the current maturity, the roadmap of the filament project. Partly to inform ourselves, but also because we want to be able to make better estimates for our clients - this particular upgrade will come at a loss for us, which is fine - we knew it was a young project going in.
2 replies
Sorting a table component (not a resource) not working
Hello, I have a component which displays a table. The query is just the all() method on the relevant model.
I have some custom filters with select fields, that all work to update the query and therefore the table results.
I want the sort to be selectable, so I made a select field , with the option to sort a given column asc or desc.
The records will not update however:
This filter works the same way as the other, working filters, but it seems that ordering is restricted, because all the 'where's work, just the 'order's do not. What am I missing here?
Thanks
2 replies
Fileupload resize doesn't seem to work, what am I missing?
The field on the resource is configured as follows:
With the above settings, cropping definitely works, as the preview saved image has the define dimensions and aspect ratio. But if the uploaded file has an aspect ratio that is not 4:3, then the image is simply cropped before resize.
eg. before and after images here: https://imgur.com/a/KeztyX0
8 replies
Search translation text (not just key)
The filament translation library is great, we are using it extensively on a project. There is one big UX issue that I would love to be able to solve. The search function doesn't search the translated text values, which kind of diminishes its usefulness, since often our users are not aware what the key is (and even with better key labelling, the should be able to query the translated text).
Are there any known solutions to this? Thanks.
2 replies
Custom field layout component does not pass $extraAttributes to blade
Hi, I followed the instructions here to create a custom layout component: https://filamentphp.com/docs/2.x/forms/layout#building-custom-layout-components in the generated blade there is an $extraAttributes variable, but I cannot pass it via the form builder as you would expect - what is missing here? Thanks
```php
CustomComponent::make()
->extraAttributes(['class' => 'not-passed-to-blade'])
->schema([])
2 replies
Refactoring closures into a trait (or some other structure)
I have a very large form with tonnes of dependant fields, dynamic hints, options etc. The entire form is full of closures and it's getting to a state where it's unweildy.
I was wondering if it's possible to refactor the code into a trait or some other file where I can keep the various functions organised.
eg. I have the following
With a public function doing the legwork:
When I move
hydrateProduct
into a trait though, I get errors, eg:
Argument #1 ($get) must be of type callable, null given, called in /private/var/www/vhosts/gunthertore/vendor/livewire/livewire/src/HydrationMiddleware/CallPropertyHydrationHooks.php on line 20
make $get
null by default:
App\Http\Livewire\Configurator\SectionalDoors::hydrateProduct(): Argument #2 ($set) must be of type callable, Livewire\Request given, called in /private/var/www/vhosts/gunthertore/vendor/livewire/livewire/src/HydrationMiddleware/CallPropertyHydrationHooks.php on line 20
Liverwire\Request? OK:
App\Http\Livewire\Configurator\SectionalDoors::hydrateProduct(): Argument #2 ($set) must be of type Livewire\Request, Closure given, called in /private/var/www/vhosts/gunthertore/app/Http/Livewire/Configurator/SectionalDoors.php on line 124
You get the picture. What am I doing wrong? Is this even possible? Is there a better way to separate the functions out than this?
Thanks2 replies
I'm encountering a bug in form Repeater?
I have a repeater that creates a Select field, the options array for the repeater should be dynamically updated based on other form fields:
The issue is that $get('manufacturer') and $get('use') returns null in the closure, even though they are non-empty fields.
The code works in other fields (this is a copy-paste of another, similar field). I tested the closure and it returns the expected select options when the correct ids are returned. My issue is that $get('field_value') is always empty in the Repeater closure.
Any ideas? Thanks
6 replies