admin eager loads relationship

This commit is contained in:
xiaomlove
2022-07-02 16:58:07 +08:00
parent c499bd7d19
commit 5cc25468a7
4 changed files with 20 additions and 0 deletions
@@ -68,6 +68,11 @@ class ClaimResource extends Resource
]); ]);
} }
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->with(['user', 'torrent', 'snatch']);
}
public static function getRelations(): array public static function getRelations(): array
{ {
return [ return [
@@ -78,6 +78,11 @@ class ExamUserResource extends Resource
]); ]);
} }
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->with(['user', 'exam']);
}
public static function getRelations(): array public static function getRelations(): array
{ {
return [ return [
@@ -82,6 +82,11 @@ class HitAndRunResource extends Resource
]); ]);
} }
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->with(['user', 'torrent', 'snatch']);
}
public static function getRelations(): array public static function getRelations(): array
{ {
return [ return [
@@ -63,6 +63,11 @@ class UserMedalResource extends Resource
]); ]);
} }
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->with(['user', 'medal']);
}
public static function getRelations(): array public static function getRelations(): array
{ {
return [ return [