samedi 15 octobre 2016

How to get two table information with belongstomany relationship in laravel 5.2?

class Movie extends Model{
  public function MoviesWithSites()
{
    return $this->belongsToMany('\App\Models\MovieSite','movie_movie_site','movie_id','site_id');
}
}

i tried with above code with that i'm getting only movie site information but i want movies table result also with it.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire