Matthew
Wizzard multiple entities per each wizzard step
https://filamentphp.com/docs/3.x/forms/advanced#saving-data-to-relationships
Not sure if it works at wizard step level, but you don't really need it to. You can also just use
relation.column
syntax on the relevant form fields7 replies
Newb question: populating table based on query
Protection yes, but also clean code. You only have to define it once, and if it changes, you only have to change it in one place.
You can then scope any child models with a
whereHas
using the relationship, and now you've automatically protected access to child model data as well.
Filament can exclude global scopes on request, for instances where you have something like a global administrator login. (Although for that, I would insist on separate guards and condition the scopes accordingly, but that's a whole other topic!)17 replies
PWA and localStorage
It's not a question of whether Filament supports it. The front-end is agnostic to whether you are online or not. You need services that handle caching of data and synchronisation.
It's a whole separate technology stack, and the front-end be it Filament, Vue, React...shouldn't really care or know.
7 replies
Newb question: populating table based on query
Global scopes apply to models, and they apply to all queries. Though they can be conditionally applied.
It is a powerful Laravel tool, you can find out what they are and how to apply them here: https://laravel.com/docs/11.x/eloquent#global-scopes
17 replies
Input Blade Component Suffix Action
ummm....I'm not an expert on views, blades and livewire...but, you are using a form, with a ViewField, then within the view that is pointed at, presumably you could have a livewire component, and within that you could have a separate form....
But, whether it would require all sorts of configuration because of multiple submits etc...not sure.
12 replies
Newb question: populating table based on query
BTW, opinion varies...but assuming these are authenticated sessions...I would always insist on global scopes at the highest and any parentless models for this, rather than applying the limitations on the resource\table directly.
17 replies
Newb question: populating table based on query
getEloquentQuery
doesn't apply if you are not using panel builder with resources.
You associate your resource with a model, which is where it gets it from.
If you are just using using the table in a livewire component. Nothing special about the query though, you just need to chain on the where method:
->query(User::query()->where('organisation',Session::get('currentOrg'))
17 replies