Specific RelationManager does not show
I have several relationship managers, but one of them has started not showing up, even though it just started happening.
When I
Order model
dd()
the relation it is there
OrderResource
public static function getRelations(): array
{
return [
RelationManagers\ServicesRelationManager::class,
RelationManagers\PassengerRelationManager::class, // Not visible
RelationManagers\VehicleRelationManager::class,
RelationManagers\PaymentsRelationManager::class,
];
}
public static function getRelations(): array
{
return [
RelationManagers\ServicesRelationManager::class,
RelationManagers\PassengerRelationManager::class, // Not visible
RelationManagers\VehicleRelationManager::class,
RelationManagers\PaymentsRelationManager::class,
];
}
/**
* @var array<int, string>
*/
protected $fillable = [
'passenger_id',
// ...
];
public function passenger(): BelongsTo
{
return $this->belongsTo(
related: PassengerInfo::class,
foreignKey: 'passenger_id',
ownerKey: 'id',
);
}
// OR
public function passenger(): HasOne
{
return $this->hasOne(
related: PassengerInfo::class,
foreignKey: 'id',
localKey: 'passenger_id',
);
}
// EVEN
public function passenger(): HasMany
{
return $this->hasMany(
related: PassengerInfo::class,
foreignKey: 'id',
localKey: 'passenger_id',
);
}
/**
* @var array<int, string>
*/
protected $fillable = [
'passenger_id',
// ...
];
public function passenger(): BelongsTo
{
return $this->belongsTo(
related: PassengerInfo::class,
foreignKey: 'passenger_id',
ownerKey: 'id',
);
}
// OR
public function passenger(): HasOne
{
return $this->hasOne(
related: PassengerInfo::class,
foreignKey: 'id',
localKey: 'passenger_id',
);
}
// EVEN
public function passenger(): HasMany
{
return $this->hasMany(
related: PassengerInfo::class,
foreignKey: 'id',
localKey: 'passenger_id',
);
}
1 Reply