morty
How to query/chart on a fiscal year? Calendar/data dimension table?
This might not be exactly Filament related but I'm working with a Filament app so I'll ask here.
I need to chart some trends based on a fiscal year of Jul 1 - June 30. I'm wondering what the best way to go about this would be?
Should I build a calendar/data dimension table in the database or would you just use Carbon to limit your queries dynamically?
4 replies
How can I fill a field on the edit form that isn't saved to the database?
On a create form, I have a 3-tiered dependent dropdown.
For example:
On a
Person
model I might have the following Country
-> State/Province
-> City
In the database on the persons table I'm only saving the city_id
since I can always look up the state and country via the city.
I have this working on the create form but when someone clicks to edit the form, how can I fill in the country_id
and state_province_id
since these don't exist from the data?
My code:
9 replies
How come we need to disable the SoftDeletingScope::class on the resource but not on relation manager
I'm starting to implement soft deletes across my models and while the documentation says we need to add
->withoutGlobalScope(SoftDeletingScope::class)
to the resource, why then do I not need to add this to the relation manager class via the ->modifyQueryUsing()
method?10 replies
Is it possible to pass the parent record to the gate of a relation manager?
I have a
Work Orders
resource and on the edit page of each is a relation manager for Work Order Notes
. I have policies for both models.
I only want to allow a work order note to be created on work orders that the logged in user owns. The problem is that Filament checks a create
method on the WorkOrderNotePolicy
that doesn't pass in anything other than the user. Eg.
Is there a way that I can pass in the parent/owner record to this method on the policy?6 replies
Has anyone successfully parsed the rich editor/trix field from the raw data in the database?
I have an application that has used the trix editor for a while. I need to migrate this data to a new application that also uses the trix editor for the same field but the difference in this new application is that it doesn't allow file uploads in the field like the old application did.
Wondering what the best way would be to rip those files out of the body of that field and upload them properly for the record.
Anyone have any experience here?
7 replies
When would you ever not want `isImportant` on the `configureUsing` method?
Related: https://discord.com/channels/883083792112300104/1344421288919302215
I had to fix some configuration that I was doing in a service provider and needed to set the
isImportant
flag to true
. Can anyone tell me why I wouldn't want to always set this to true? I'm not understanding why this is even a thing?
Thanks.1 replies
Can't seem to globally change the AttachAction modal width?
I have a service provider where I'm configuring defaults for many components. One component I'm trying to configure is the
Filament\Tables\Actions\AttachAction
modalWidth
.
I'm doing the following:
This does not seem to be working though. Any ideas why? It seems both the AttachAction
and the AssociateAction
are setting the modal width in their setUp
method and I thought I could override this in the configureUsing
should I not be able to?3 replies
Is there a way to evaluate this immediately without returning a closure?
I want to return an array here but I also need to check the operation of the form if it's in
create
or edit
. I don't want to return a closure because it's slower due to querying the database when the user focuses the field. I'd rather load these on page load which returning an array would do.
4 replies