matthewpeavoy
matthewpeavoy
FFilament
Created by DianaMujoiu on 6/7/2023 in #❓┊help
Relation manager in custom page
$record is just a model assigned in the mount() method, and this is how I'm pulling in the relation manager class. public function getRelationManagers(): array { return [ LicenseRelationManager::class ]; } One last note: :active-manager="0" is just an array key, so could be controlled dynamically. I haven't tried it with multiple managers yet.
5 replies
FFilament
Created by DianaMujoiu on 6/7/2023 in #❓┊help
Relation manager in custom page
I was able to add a relationship manager to a custom page using the following blade setup. I just created a new relation manager class (just a random PHP class, not in a resource) by copying / pasting the format. <x-filament-panels::page> <x-filament-panels::form wire:submit="update"> {{ $this->form }} {{-- // add form actions --}} <x-filament-panels::form.actions :actions="$this->getFormActions()" /> </x-filament-panels::form> @php $relationManagers = $this->getRelationManagers(); // dd($relationManagers); @endphp <x-filament-panels::resources.relation-managers :active-locale="null" :active-manager="0" :content-tab-label="'Tab'" :managers="$relationManagers" :owner-record="$record" :page-class="static::class" > </x-filament-panels::resources.relation-managers> </x-filament-panels::page>
5 replies