F
Filamentβ€’14mo ago
onursahindur

Price list for subscriptions

Hello all, I want to show a price (tier) list for admins to subscribe to any package when managing their subscriptions. I want to achieve a page like this one, I thought creating a new resource and add use index page as a custom page, then make this cards as Widget components. I was going well but bumped to a problem that how can I transfer data to these widgets? 1. I created a PackageResource, 2. a custom ShowPackageResourcePage 3. a PackageWidget widget using in getHeaderWidgets() function in ShowPackageResourcePage In PackageResource I was querying all packages directly. However how can I transfer this packages one-by-one to specific widgets. I will have 3 tiers, free, pro and pro+, so I need to show their details on these widgets. Do you have any suggestions?
7 Replies
onursahindur
onursahindurβ€’14mo ago
This is my development page, Basically I want to show all Tiers not in a datatable, but as a card or widget view. Is this possible?
Dennis Koch
Dennis Kochβ€’14mo ago
What's wrong with your page? Seems like a good start and only needs some styling?
onursahindur
onursahindurβ€’14mo ago
Thanks πŸ™‚ Yes, I stated on the first message "I was going well but bumped to a problem that how can I transfer data to these widgets?" This is my problem πŸ˜‚
Dennis Koch
Dennis Kochβ€’14mo ago
Sorry, overlooked that one. Pages are just normal Livewire components. So whatever is true for them is true for pages. https://laravel-livewire.com/docs/2.x/properties
Livewire
Properties | Livewire
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
onursahindur
onursahindurβ€’14mo ago
Thanks for tip. I do not have much experience with Livewire, so basically you are suggesting to use properties? For example I need to fetch tiers on custom page than send them to the view of that custom page?
Dennis Koch
Dennis Kochβ€’14mo ago
It was just the start of the Data Binding section of the livewire docs. I'd probably use computed properties. You should have a basic understanding of Livewire for Filament
onursahindur
onursahindurβ€’14mo ago
Okay, I understand now, Let me check the document and start to understand the basics. Thank you for your help