morty
morty
FFilament
Created by morty on 3/12/2025 in #❓┊help
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.
class WorkOrderNotePolicy
{
public function create(User $user): bool
{
//
}
}
class WorkOrderNotePolicy
{
public function create(User $user): bool
{
//
}
}
Is there a way that I can pass in the parent/owner record to this method on the policy?
6 replies
FFilament
Created by morty on 3/5/2025 in #❓┊help
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
FFilament
Created by morty on 3/3/2025 in #❓┊help
How can I aggregate a field on a pivot table with TextColumn->sum()?
My code:
TextColumn::make('locations_sum_available_quantity')
->label('Inventory')
->sum('locations', 'inventories.available_quantity')
->badge()
->alignCenter()
->sortable(),
TextColumn::make('locations_sum_available_quantity')
->label('Inventory')
->sum('locations', 'inventories.available_quantity')
->badge()
->alignCenter()
->sortable(),
I can't seem to get this to work. Is it possible to aggregate a field on the pivot table?
3 replies
FFilament
Created by morty on 2/27/2025 in #❓┊help
Is there a way in Filament to calculate a field on the client side without Livewire? AlpineJS?
No description
12 replies
FFilament
Created by morty on 2/27/2025 in #❓┊help
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
FFilament
Created by morty on 2/26/2025 in #❓┊help
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:
Tables\Actions\AttachAction::configureUsing(function (Tables\Actions\AttachAction $component): void {
$component->modalWidth(MaxWidth::Medium);
});
Tables\Actions\AttachAction::configureUsing(function (Tables\Actions\AttachAction $component): void {
$component->modalWidth(MaxWidth::Medium);
});
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
FFilament
Created by morty on 2/12/2025 in #❓┊help
Confused about form grid columns and column span.
No description
3 replies
FFilament
Created by morty on 2/12/2025 in #❓┊help
How can I position these stat widgets on the dashboard?
No description
5 replies
FFilament
Created by morty on 2/11/2025 in #❓┊help
Spatie Media Library Plugin black screen on upload of some files
No description
8 replies
FFilament
Created by morty on 2/5/2025 in #❓┊help
Is there a way to allow Split (table layout) to work on all breakpoints?
For example, even if I do ->from('2xl') then it still only works on all BUT 2xl. I want it to work on all and never switch to the traditional layout.
4 replies
FFilament
Created by morty on 1/22/2025 in #❓┊help
Is it possible to remove images/files from storage when removed in the rich editor field?
n/t
1 replies
FFilament
Created by morty on 1/21/2025 in #❓┊help
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.
Forms\Components\Select::make('priority')->options(fn (string $operation) => WorkOrderStatus::options($operation))
Forms\Components\Select::make('priority')->options(fn (string $operation) => WorkOrderStatus::options($operation))
4 replies
FFilament
Created by morty on 1/9/2025 in #❓┊help
Dependent select without parent being saved to the database
No description
6 replies
FFilament
Created by morty on 12/3/2024 in #❓┊help
Is the Filament\Forms\Components\Group component documented anywhere?
What is the difference between Grid and Group?
5 replies
FFilament
Created by morty on 11/29/2024 in #❓┊help
How can I disable global search for a resource while still setting a `recordTitleAttribute`?
I have several resources but I want to exclude a few from the global search. Unfortunately I do not want to remove the $recordTitleAttribute because this does other things for the resource like handling the breadcrumbs and titles. The documentation shows how I can disable it for the panel, but I don't want to do that. I just want to disable it for the specific resource. Is this possible?
3 replies
FFilament
Created by morty on 9/10/2024 in #❓┊help
Tailwind CSS: Unhandled exception: require() of ES Module
No description
4 replies
FFilament
Created by morty on 9/4/2024 in #❓┊help
What does `->evaluate()` do?
I see this all over the code base but not really understanding entirely what it's doing. Can someone explain?
5 replies
FFilament
Created by morty on 8/29/2024 in #❓┊help
Added colour not working
No description
8 replies
FFilament
Created by morty on 8/28/2024 in #❓┊help
Make field read-only but also styled as if it was disabled?
Is this possible? ->readOnly() is what I want functionally but ->disabled() is what I want visually. If I use ->disabled() then the field is not submitted with the form, but if I use ->readOnly() then the field is still focusable and looks active.
6 replies
FFilament
Created by morty on 8/27/2024 in #❓┊help
If I want to extend a form component to my own class, where do I do this?
I guess what I'm asking is where in the app structure would you do this?
5 replies