I am trying to get the data from multiple tables for the table structure given below
Content for the tables are
In above scenario I just want to fetch the array of unique movie_id for the city_id=1 and my code is given below
$movies=General_cities::with('cinemahall.showtime')->where('city_id',$selectedcity->city_id)->get();
return $movies[0]['cinemahall'][1]['showtime'][0]['movie_id'];
where $selectedcity->city_id is "1", I am getting all the data in bunch from above code. I am also able to display single movie_id , but i want to traverse from all the multidimentional array and collect the all unique movie_id.
kindly help me as this seems to be quite difficult to do. in above scenario i should get the movie_id array as [1,2].
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire