π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/11/2025 in #ββhelp
RelationManager Attach and Detach possible values
At the moment I'm thinking it should have it's own Edit page where it simply displays what would otherwise be the owner Record as read only fields for visual consistency, and then uses a form with Forms\Components\CheckboxList, doing a bulk attach/detach. But I will loop back to that later
23 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/11/2025 in #ββhelp
RelationManager Attach and Detach possible values
Bit more code then in case anything obvious jumps out
23 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/11/2025 in #ββhelp
RelationManager Attach and Detach possible values
If I change
Action::make('deny')
to perform givePermissionTo
it doesn't work which doesn't help much, but either way when I use the permit
button to run ->action(fn () => dd('hit')),
that doesn't even do the dd23 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/11/2025 in #ββhelp
RelationManager Attach and Detach possible values
The
Action::make('deny')
works and detaches the permission from the role23 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/11/2025 in #ββhelp
RelationManager Attach and Detach possible values
Thanks for the offer, as I said the detch or deny action works great, the attach or permit action won't even do a dd
23 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/11/2025 in #ββhelp
RelationManager Attach and Detach possible values
Sorry to tag you, but I am really stuck on this, no matter what I do I cannot get the 'attach' action to even do the dd('hit') - it posts but nothing is shown. I can't make it log output or anything and I feel I must be doing something fundamentally wrong
23 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/11/2025 in #ββhelp
RelationManager Attach and Detach possible values
FYI in my case idc about the filters so I did just override the query, meaning the tabs subsequently modify it correctly \o/
23 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/11/2025 in #ββhelp
RelationManager Attach and Detach possible values
I'm struggling to combine it with tabs, which also overloads modifyQueryUsing... I will get there!
23 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/11/2025 in #ββhelp
RelationManager Attach and Detach possible values
That's amazing! Thank you so much! In fairness I am fine to figure out the table actions, it's mostly this bit I was not sure about
$table
->modifyQueryUsing(fn ($query) => $query = Permission::query())
- does this simply point at the model Permissions and get them?23 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/11/2025 in #ββhelp
RelationManager Attach and Detach possible values
Yes exactly that! So how do I render all permissions? The attach/detach would in this case need to be on $role->has but that should work too since it's an operator exposed by Spatie (which I'm using underneath ofc)
23 replies
FFilament
β’Created by Ookma-Kyi on 2/7/2025 in #ββhelp
Policy to allow admins to edit models in the admin panel
You are over complicating it I think? Try removing the auth->check from the if and simply return true if hasRole and routeIs?
For readability maybe change your other return to be wrapped in an if and return true, and add a return false at the end?
4 replies
FFilament
β’Created by ffffer. on 2/8/2025 in #ββhelp
V4 needed
If you absolutely have to use it, you could set the filament github as a manual βvcsβ repository in composer.json or fork the v4 dev branch only to your own GitHub repository and add that as the vcs source so thereβs literally just the one branch to install. Then it would be a case of synching upstream regularly.
6 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/5/2025 in #ββhelp
Cluster, subNav, add the CreateRecord action page to parent
Cool, so I figured it out.
trait HasSubNavigation
has a method public function getCachedSubNavigation(): array
which constructs the Nav from scratch based on the values passed to it, and does not honour, or even set at all, the collapsible method, when a qualified NavigationGroup is passed.
One possibility, is to override getCachedSubNavigation
in the Cluster class and either hardcode collapsible to false or add code to make it honour all methods. The downside to doing it this way is that if you have added the cluster subnav to your create/view/edit pages, they will also need the getCachedSubNavigation
amended.
So better, is probably to manually edit the Trait filament/packages/panels/src/Pages/Concerns/HasSubNavigation.php
with the fix to avoid all of that.
I'll also open an issue on the GitHub and submit a PR for a hopefully non-breaking fix.
It does however look like the SubNav trait and implementation is quite messy. It doesn't use NavigationManager or NavigationBuilder. I'll raise a separate issue on GitHub to discuss that. Either it might be worth having HasSubNavigation trait applied at the panel level so it can be configured on $panel or applied on a Cluster, and update the Cluster generator to include the trait on the generated class <List|Create|etc>$Model extends <List|Create|etc>Records
classes10 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/5/2025 in #ββhelp
Cluster, subNav, add the CreateRecord action page to parent
Comparing setting
getClusteredComponents
only, setting getSubNavigation
only and setting both, I can tell that only getClusteredComponents
and the navgroup properties set in those classes is changing anything.
That means that the getSubNavigation()
method in panels/src/Clusters/Cluster.php
is actually not doing anything at all, hence overriding it makes no difference10 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/5/2025 in #ββhelp
Cluster, subNav, add the CreateRecord action page to parent
Okay, so I went into the blade
vendor/filament/filament/src/../resources/views/components/page/sub-navigation/sidebar.blade.php
and added @dump($navigation)
and #isCollapsible: null
not false or true10 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/5/2025 in #ββhelp
Cluster, subNav, add the CreateRecord action page to parent
Thanks, the blade is set up to respect the prop for collapsible(false|true), it just doesn't seem to receive it. I'm going to see about setting the blade file to dump the contents of props to the debug log and see what it actually gets sent, and try to trace that down
10 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/5/2025 in #ββhelp
Cluster, subNav, add the CreateRecord action page to parent
Would appreciate any suggestions! I am surprising myself how far I am getting but definitely feel like I am missing something
10 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/5/2025 in #ββhelp
Cluster, subNav, add the CreateRecord action page to parent
Okay, I am really lost with this, if I override
getClusteredComponents
in the Cluster class, I get my List/Create menuitems for the two Resources.
If I try to override getSubNavigation
I can instantiate the class in tinker and dd($cluster->getCachedSubNavigation());
and it shows the groups with collapsible false set, but ultimately the databind to the page doesn't seem to make it.
I am assuming that somewhere else the getSubNavigation is overridden and uses the getClusteredComponents from the Cluster, but does not use the getSubNavigation from Cluster.10 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/5/2025 in #ββhelp
Cluster, subNav, add the CreateRecord action page to parent
Okay, so some progress.
1. NavigationGroup definitions on $panel are ignored in the cluster (I assume this is intentional?)
2. In the Cluster definition I can override
public static function getClusteredComponents(): array
to return the Resource::class
and Create$Model::class
and that'll generate navItems, I still need to go into my Resource and Create page and set protected static ?string $navigationGroup
, navIcon, navOrder etc etc however doing it this way means I can't set the GroupIcon or set collapsible(false).10 replies
FFilament
β’Created by π
Έ π
°π
Ό π
³π
°π
³π
Όπ
Έπ
½ on 2/5/2025 in #ββhelp
Table merging Heading and Toolbar
Yeah was looking like I am needing to extend ListRecords and/or use custom blade, wanted to confirm though! Cheers
5 replies