Skip to content

Relationship fields in Edit Page running the field method. #5900

@carl1498

Description

@carl1498

Found out that assigning a simple belongsTo relationship is running its own fields method. In this case I want to assign a catalogue to an account.

e.g. App\Nova\Account.php@fields

BelongsTo::make('Primary Catalogue', 'primaryCatalogue', 'App\Nova\Catalogue')
    ->hideFromIndex()
    ->rules('nullable')
    ->searchable(),

but my App\Nova\Catalogue@fields has this Tab

Tab::make('Pages', [
    CataloguePages::make()
        ->themePages((new PageServices)->getThemePages(App('entity')->theme))
        ->model($this->load('pages.page')->toArray())
]),

which loads up a lot of pages, this is acceptable if I'm in the catalogue show page but when I'm just assigning a catalogue to an account, I don't think this is necessary and it's just loading up pages for all those catalogues. Is there a way to disable or at least selectively ignore fields in this scenario?

I temporarily used searchable just to avoid loading up catalogues all at once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions