Support the ongoing development of Laravel.io →
Database Eloquent Architecture
Last updated 2 years ago.
0

Use pivot tables. Inside the pivot you will make a start_time and end_time column. Eloquent doesn't support models with composite primary keys, so if you really need that time model, then make a foreign key in the pivot.

Last updated 2 years ago.
0

Firtzberg said:

Use pivot tables. Inside the pivot you will make a start_time and end_time column. Eloquent doesn't support models with composite primary keys, so if you really need that time model, then make a foreign key in the pivot.

won't I have to make the primary id of hall_movie table the foreign key of times table?

also, how would I go about accessing these times with eloquent?

Last updated 2 years ago.
0

Take a look at http://laravel.io/forum/10-16-2014-eloquent-will-also-assume-that-each-table-has-a-primary-key-column-named-id I posted some code there that might point you in the right direction.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.