-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
- Laravel Version: 10.x.x
- Nova Version: 4.0
- PHP Version: 8.1
- Database Driver & Version: MYSQL
- Operating System and Version: Ubuntu 22.04
- Browser type and version: Chrome
- Reproduction Repository: Private
Description:
I have users, twitter_user tables, and components tables these three tables have a Morph relationship
Relationship Code
// Component Model
public function author()
{
return $this->morphTo()->withDefault(function () {
return new TwitterUser([
'name' => 'Anonymous',
'anon' => true,
'slug' => 'anon',
'avatar' => '/svg/anon.svg',
]);
});
}
//------------------------------------------------------------------------
// User Model
public function components()
{
return $this->morphMany(Component::class, 'author');
}
//----------------------------------------------------------------------
// Nova Field
MorphTo::make('author')->types([
User::class,
TwitterUser::class,
])->nullable(),So the issue is when I select the user option from the menu the app crashes after some debugging I found the reason is the user's table has much data over 14k rows. This issue happened in the create and edit pages How can I paginate the relation on the edit page I need just the author that has created the component if I want to update and then load the users with pagination.
Metadata
Metadata
Assignees
Labels
No labels
