hi I have a Branches with a Position table
in my Branches Model class I have:
public function position()
{
return $this->hasOne('Model\Branch\Position');
}
in the Position table I have:
protected $fillable = ['latitude','longitude','branch_id','business_id'];
public function branches()
{
return $this->belongsTo('Model\Branch','branch_id');
}
now I get the latitude and longitude of my client
how I can show him what branches he have in here 20 KM radios?
the simple why with Eloquent