Access the relationship using Select
Field
#1990
-
When I was dealing WITH the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Form an accessible list in the query method; public function query(): array
{
$this->personalOptionsForTheUser = [
'key' => 'value',
];
} After that, you can pass it through the property: Select::make('select')
->options($this->personalOptionsForTheUser) If the field is used in another class, you can use |
Beta Was this translation helpful? Give feedback.
-
I wrote this code and I got the correct result Select::make('user.post')
->fromModel(\App\Models\Post::class, 'title')
->required()
->title(__('Title'))
->help('Specify which title you should belong to'), |
Beta Was this translation helpful? Give feedback.
I wrote this code and I got the correct result