Fields

HasOneThrough

Extends HasMany

  • has the same features

The HasOneThrough field is designed to work with the relation of the same name in Laravel, inherits from the HasOne field and includes all its methods.

use MoonShine\Fields\Relationships\HasOneThrough;
 
//...
 
public function fields(): array
{
return [
HasOneThrough::make('Car owner', 'carOwner', resource: new OwnerResource())
];
}
 
//...