Specific Relation Manager in Custom View

Hello, How to display individual relation managers in custom view? Is there any way to show a specific relation manager using this code snippet?
<x-filament-panels::resources.relation-managers
:active-manager="$activeRelationManager"
:managers="$this->getRelationManagers()"
:owner-record="$record"
:page-class="static::class"
/>
<x-filament-panels::resources.relation-managers
:active-manager="$activeRelationManager"
:managers="$this->getRelationManagers()"
:owner-record="$record"
:page-class="static::class"
/>
Also, would it be possible to enable CRUD operations for relation managers in the custom view page? Thank You. 🙂
4 Replies
Patrick Boivin
Patrick Boivin15mo ago
I feel like it should be possible, but I haven't tried. Have you? Did you run into any issues?
Sanchit Patil
Sanchit PatilOP15mo ago
I am trying something like this
@php
$rm = $this->getRelationManagers();
$splitrm = [];
foreach ($rm as $item) {
$splitrm[] = [$item];
}
@endphp

<x-filament-panels::resources.relation-managers
:active-manager="0"
:managers="$splitrm[0]"
:owner-record="$record"
:page-class="static::class"
/>
<x-filament-panels::resources.relation-managers
:active-manager="1"
:managers="$splitrm[1]"
:owner-record="$record"
:page-class="static::class"
/>
@php
$rm = $this->getRelationManagers();
$splitrm = [];
foreach ($rm as $item) {
$splitrm[] = [$item];
}
@endphp

<x-filament-panels::resources.relation-managers
:active-manager="0"
:managers="$splitrm[0]"
:owner-record="$record"
:page-class="static::class"
/>
<x-filament-panels::resources.relation-managers
:active-manager="1"
:managers="$splitrm[1]"
:owner-record="$record"
:page-class="static::class"
/>
it shows the first RM but not the second one sadly. sorry, my bad this works
<x-filament-panels::resources.relation-managers
:active-manager="0"
:managers="$splitrm[0]"
:owner-record="$record"
:page-class="static::class"
/>
<x-filament-panels::resources.relation-managers
:active-manager="0"
:managers="$splitrm[1]"
:owner-record="$record"
:page-class="static::class"
/>
<x-filament-panels::resources.relation-managers
:active-manager="0"
:managers="$splitrm[0]"
:owner-record="$record"
:page-class="static::class"
/>
<x-filament-panels::resources.relation-managers
:active-manager="0"
:managers="$splitrm[1]"
:owner-record="$record"
:page-class="static::class"
/>
active manager in the second resource was wrong. Could anyone please help me to make the RM editable in the view record? currently, it is read-only.
Sanchit Patil
Sanchit PatilOP15mo ago
perfecto, thank you 🙂
Want results from more Discord servers?
Add your server