diff --git a/resources/js/Components/Pages/RecordsPage.tsx b/resources/js/Components/Pages/RecordsPage.tsx index feb7cef4e..6824c7615 100644 --- a/resources/js/Components/Pages/RecordsPage.tsx +++ b/resources/js/Components/Pages/RecordsPage.tsx @@ -510,10 +510,10 @@ export class RecordsPage extends Page { const select = section.fields[field.id] as SelectT; let {options} = select; - const {model, labelAttribute} = select; + const {relationship} = select; - if (model && labelAttribute) { - options = this.getModelSelectOptions(model, labelAttribute); + if (Array.isArray(relationship) && relationship.length === 2) { + options = this.getModelSelectOptions(relationship[0], relationship[1]); } if (options instanceof Promise) { diff --git a/resources/js/typings/forms.ts b/resources/js/typings/forms.ts index b81411a46..dc7ec513f 100644 --- a/resources/js/typings/forms.ts +++ b/resources/js/typings/forms.ts @@ -87,6 +87,5 @@ export type SelectT = FieldT & { items?: ListItemBase[] index?: number options?: SelectOptionsT | Promise, - model?: typeof Model, - labelAttribute?: string + relationship?: [typeof Model, string], };