#Shops.php
public function Customers() {
return $this->hasMany('App\Customers');
}
#Customers.php
public function Telephone() {
return $this->hasMany('App\Telephones');
}
public function Shops()
{
return $this->belongsToMany('App\Shops');
}
#Telephones.php
public function Customers()
{
return $this->belongsToMany('App\Customers');
}
#shops
Shop ID Shop Name
1 Name 01
2 Name 02
#Customers
Customer ID customername shop_id
1 John 1
2 Adam 2
3 Steve 1
4 Andy 1
Well you have multiple customers, so you need to loop over them to get the phone numbers
$telephones = [];
foreach ($shop->customers as $customer) {
$telephone [] = $custom->telephone->telephone;
}
// You now have an array of all the telephone numbers