Support the ongoing development of →
posted 4 years ago
Last updated 2 years ago.

You can create table 'seats' with (idbus, numoftheseat, available (true or false), like this you can get all available (or not) seats for each bus easy.. and number of this of course ( ->count() ).

Last updated 4 years ago.

Are you trying to establish how many seats are unreserved on a trip, or exactly which seats are unreserved on a trip?

Not to sound critical, but your tables have strange names - naming can contribute a lot to simplifying the thought process. Why not have tables like:

• Busses (with columns like capacity, license_number, etc.)

• Trips (columns like departure_time, arrival_time, destination, etc.) - each Bus has many Trips

• Seats (columns like seat_number, passenger_name) - each Trip has many Seats

Last updated 4 years ago.

Sign in to participate in this thread!


Your banner here too?


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

Your logo here?

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

© 2024 - All rights reserved.