You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for try to make our lifes easier! This is a very good solution. :)
Give me a little help?
I have the following eloquent entities:
Movie
MovieSession
MovieTheater
MovieTheaterRoom
where a MovieTheater hasMany MovieTheaterRooms, each MovieTheaterRoom hasMany MovieSessions and each MovieSession belongsTo a Movie.
What I'm trying, is to get all Movies that are playing today on a MovieTheater by its $movieTheaterId, but since it is a long relation, I'm unable of retrieve such collection.
And when calling App\Models\MovieTheater::find(1)->movies()->get()
This is the output:
Illuminate/Database/QueryException with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'movie_sessions.movie_theater_id' in 'field list' (SQL: select movies.*, movie_sessions.movie_theater_id from movies inner join movie_theater_rooms on movie_theater_rooms.id = movies.movie_theater_room_id inner join movie_sessions on movie_sessions.id = movie_theater_rooms.movie_session_id where movie_sessions.movie_theater_id = 1)'
Where I'm wrong?
The text was updated successfully, but these errors were encountered:
First of all, thanks for try to make our lifes easier! This is a very good solution. :)
Give me a little help?
I have the following eloquent entities:
where a MovieTheater hasMany MovieTheaterRooms, each MovieTheaterRoom hasMany MovieSessions and each MovieSession belongsTo a Movie.
What I'm trying, is to get all Movies that are playing today on a MovieTheater by its
$movieTheaterId
, but since it is a long relation, I'm unable of retrieve such collection.This is what I'have tried:
And when calling
App\Models\MovieTheater::find(1)->movies()->get()
This is the output:
Where I'm wrong?
The text was updated successfully, but these errors were encountered: