nicobrave
nicobrave
FFilament
Created by nicobrave on 9/19/2024 in #❓┊help
Summary of all the column values
Hello! I created this text column that shows the total sum of every row I have in the table:
Tables\Columns\TextColumn::make('sum_total_row')
->label('Activities Total')
->default( fn(Model $record) => $record->activities->sum('pivot.attributeX'))
->money('EUR')
->summarize(Summarizer::make()
->label('Total')
->using(fn () => 888)
);
Tables\Columns\TextColumn::make('sum_total_row')
->label('Activities Total')
->default( fn(Model $record) => $record->activities->sum('pivot.attributeX'))
->money('EUR')
->summarize(Summarizer::make()
->label('Total')
->using(fn () => 888)
);
I also want to show the total sum of this specific column values. I managed to show a hardcoded number (888) above the column, but I can't show the dynamic sum. I can't use the standard way to calculate the column sum, because this is not a DB column, it's dynamically created in my ManageRelatedRecords class. Thanks!
4 replies
FFilament
Created by nicobrave on 8/23/2024 in #❓┊help
Customize breadcrumb only for a specific Resource
I need to customize the breadcrumb for a specific Resource. At the moment it's the following: "Activities / Activity-1 / Edit" But I want to add the parent Resource (Project) at the beginning, like this: "Projects / Project-1 / Activities / Activity-1 / Edit" Is this possible?
2 replies
FFilament
Created by nicobrave on 8/12/2024 in #❓┊help
Nested Resources with manyToMany relationship
Hello! What I'm trying to do: I'm trying to implement a three-level deep nested resources project, where one of the relationship is a manyToMany relationship (ActivityEmployee). These are the models and relationships: A PROJECT has only one WORKGROUP. A WORKGROUP may correspond to several PROJECTS. A WORKGROUP has many EMPLOYEES. An EMPLOYEE may correspond to several WORKGROUPS. A PROJECT has many ACTIVITIES. An ACTIVITY correspond to only one PROJECT. An ACTIVITY may correspond to one or more EMPLOYEES. An EMPLOYEE may correspond to one or more ACTIVITIES. Basically I want to enter a PROJECT and see the related ACTIVITIES. Clicking on one of those ACTIVITIES I want to associate one or more EMPLOYEES. This is a route example: ../projects/1/activities/3/employees/2 What I tried: I tried "Nested Resources" by Guava, but it does not support manyToMany relationships. Thanks!
2 replies