© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
ingmontoya

custom summarizer

I've been trying to make a custom Summarizer with the
using
using
method but it doesn't receive a $record as a parameter and don't know how to pass the fk value, this is the code:
->using(
                                function (Builder $query) {
                                    $records = $this->table->getRelationshipQuery()->whereKey('patient_id');
                                    dd($records);
                                    $sum = DB::table('service_patients')
                                        ->select(DB::raw('sum(services.cost_per_unit) as sumService'))
                                        ->leftJoin('services', 'service_patients.service_id', '=', 'services.id')
                                        ->where('service_patients.patient_id', 1)
                                        ->get();
                                    return $sum[0]->sumService;
                                }
                            )
->using(
                                function (Builder $query) {
                                    $records = $this->table->getRelationshipQuery()->whereKey('patient_id');
                                    dd($records);
                                    $sum = DB::table('service_patients')
                                        ->select(DB::raw('sum(services.cost_per_unit) as sumService'))
                                        ->leftJoin('services', 'service_patients.service_id', '=', 'services.id')
                                        ->where('service_patients.patient_id', 1)
                                        ->get();
                                    return $sum[0]->sumService;
                                }
                            )

I only need to pass the
service_patients.patient_id
service_patients.patient_id
value but don''t know how. Any ideas?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

SUMMARIZER USING CUSTOM DATA
FilamentFFilament / ❓┊help
4mo ago
Summarizer On Custom Table
FilamentFFilament / ❓┊help
6mo ago
Duplicate summarizer
FilamentFFilament / ❓┊help
15mo ago
Summarizer label
FilamentFFilament / ❓┊help
2y ago