filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.3k stars 2.96k forks source link

recordTitleAttribute of RelationManager cannot resolve eloquent accessor. #9566

Closed NaungYeHtet closed 11 months ago

NaungYeHtet commented 1 year ago

Package

filament/filament

Package Version

3.0.0

Laravel Version

10.10

Livewire Version

No response

PHP Version

8.2.12

Problem description

image

The problem is with AttachAction when the model load it has to show the title attribute.

Expected behavior

Can show recordTitleAttributes with RelationManagers and accessors

Steps to reproduce

  1. Edit Tag
  2. Click on attach of OptionRelationManager

Reproduction repository

https://github.com/NaungYeHtet/filament-naungyehtet/tree/issue/record-title

Relevant log output

No response

danharrin commented 11 months ago

Because we use pluck(). You can use recordTitle(fn ($record) => $record->custom_name) instead.