Skip to content
Discussion options

You must be logged in to vote

Hi there,

Unfortunately, this is something that we are not able to support at the moment for various limitations and since it may be solved with an upcoming feature I don't think it is worth it to complicate BelongsTo field at the moment.

In the meantime I believe you can use the following:

BelongsTo::make('Entity Code', null, Entity::class)
  ->exceptOnForms()
  ->sortable(),

Select::make('Entity Code')
  ->options(function () {
    return \App\Models\Entity::query()->pluck('name', 'code');
  })->onlyOnForms()
  ->hideWhenUpdating()
  ->creationRules('exists:entities,code'),

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@feeh27
Comment options

Answer selected by crynobone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5014 on November 04, 2022 04:25.