Have you looked at the documentation? There are examples there.
http://laravel.com/docs/5.0/eloquent#relationships
More specifically:
http://laravel.com/docs/5.0/eloquent#many-to-many
You will need to define their relationships:
class Owners extends Model {
public function dogs()
{
return $this->belongsToMany('App\Dogs');
}
}
class Dogs extends Model {
public function owners()
{
return $this->belongsToMany('App\Owners');
}
}
You also need a dog_owner pivot table, with two columns:
- dog_id
- owner_id