I think I'm confusing myself and making this too complicated. At this point, I need outside advice.
I have a Laravel 7 application where a user will enter orders. Each order has one customer. Each order has one contact. Each customer has many contacts, but contacts only belong to one customer.
When the user is entering the order and chooses a customer, another select field populates with contacts associated with that customer.
Here is my structure:
orders table: id customer_id contact_id
Customers table: id name
Contacts table: id customer_id
Is this good or do I need to change the structure? I'm having trouble setting up the relationships in Laravel.