© 2026 Hedgehog Software, LLC

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

How to show Count relationship in table?

What im trying to do:
i want to make a report for mutation that happen in the products based on monthly filter.
the model is product has many transaction and transaction has one transaction details.
the stock in and out is in the transaction details.

what i did:
because its based on monthly filter so i think i would choose the transactions.
this is my base query.

Transaction::query()->with(['product', 'transactionDetail'])->whereHas('transactionDetail')
Transaction::query()->with(['product', 'transactionDetail'])->whereHas('transactionDetail')


my issue is:
how to show the product name, and then total stock in from the transaction details and total stock out. i wont to see all the transaction just the product name and the total of mutation.
Screenshot_1.png
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

Custom table relationship count
FilamentFFilament / ❓┊help
3y ago
How to show count of relationship from a belongs to many through relationship?
FilamentFFilament / ❓┊help
3y ago
How to show in a column from table sum from relationship
FilamentFFilament / ❓┊help
3y ago
Show navigation badge in sub navigation with count of relationship
FilamentFFilament / ❓┊help
14mo ago