F
Filamentβ€’15mo ago
Jon Mason

Any good tutorials on building an actual app with Filament?

The tutorials I'm seeing with Filament are primarily admin panel CRUD functionality, which is great, but I'm struggling to understand how I can go about incorporating my existing Laravel Livewire app into Filament. The app is a lot more complex than just CRUD functionality. It calls external APIs and has broadcast notifications and all kinds of things going on. I'd love to see an example of how someone structures an app like this in terms of where the business logic lives, and where you'd make API calls and whatnot. Are the Resource classes supposed to function like Controllers? or are Resources something else that I use in addition to controllers? In my existing app, I took the approach of not really using controllers, I have a bunch of full page livewire components. I'd love some insights from folks who are smarter than me, or any ideas on good tutorials or open source projects I could explore? This is like my 2nd day with Filament and I see how it could be a really powerful tool if I can get my mind around it.
12 Replies
toeknee
toekneeβ€’15mo ago
So you can still do exactly that too! Just build a custom page and load what you need too in, if you want to use custom API Calls for datatables you can use the Sushi package for custom models
Jon Mason
Jon MasonOPβ€’15mo ago
So in that scenario, a custom page would be in place of a resource, and I would just add whatever methods I need for that page ?
toeknee
toekneeβ€’15mo ago
Exactly, Resources are just soley for CRUD applications or rendering CRUD Data, if you are not using a CRUD then build a custom page πŸ™‚ Say you want a table though, you would then have a resource and maybe some widgets
Jon Mason
Jon MasonOPβ€’15mo ago
So let's say in my custom page I want a table, I could call the table method within my Livewire Component class?
toeknee
toekneeβ€’15mo ago
Yep you sure can, but if you want a table what would you be wanting to do beyond what a resource looks like?
awcodes
awcodesβ€’15mo ago
for reference a 'Custom page' is a Livewire component. So you can add forms, table, anything you really want to it.
Jon Mason
Jon MasonOPβ€’15mo ago
I mean, I guess at the end of the day, it's all CRUD, but one example I'm thinking of in particular is I have a table of transactions that are fetched from Quickbooks. Each row has a "sub-row" with matching transactions from our database...
toeknee
toekneeβ€’15mo ago
Ok so that's more complicated, but you could try and use sushi along with the filament table group method
Jon Mason
Jon MasonOPβ€’15mo ago
ok, that's something I'll have to explore. Trying to just get my mind around the basics at the moment. There's a lot to learn, but it's pretty exciting to me if I can make it work..
toeknee
toekneeβ€’15mo ago
There is, just try not to over think it. Quite often Filament really simplifies things and if you are slightly struggling just ask
toeknee
toekneeβ€’15mo ago
https://filamentphp.com/docs/3.x/tables/grouping Oj the grouping, and as filament is an eloquent based package you can follow any laravel methodology for getting the data, which is usually with sushi if it's not database related
Jon Mason
Jon MasonOPβ€’15mo ago
thanks for your help!
Want results from more Discord servers?
Add your server