i have 3 models that i want to start from a and load the relation with b and i want to load the relation betwen b and c there in a too is that possible ?? here is what i want to do in code :
AccommodationRoomModel which is the B model:
public function accommodation(){
return $this->belongsTo(Accommodation::class);
}
public function roomPricingHistory(){
return $this->hasMany(RoomPricingHistory::class);
}
and in The accomodation model :
public function accommodationRoom()
{
return $this->Hasmany(AccommodationRoom::class);
}
and finaly in the room pricingHistory :
public function accommodationRoom(){
return $this->belongsTo(AccommodationRoom::class);
}
now in my accomodation controller i want to get All the accomodation with the room and from room i want to get the price so here is it
A = Accomodation
B = Room
C = price
and i want to call somehow like this
From A get B and The relation Of it with C and show all in A