@Djbethel It seems a subscription can have many employers, and an employer belongs to a subscription. Therefore, this is a one-to-many relation, not a many-to-many relation.
Need Help With Unorthodox Pivot Table
It is my understanding that a pivot table should only be used with many to many relationships. But here's my problem.
I have a 'packages' table that stores general data about the different pricing packages my site offers. Then I have an employer table, which is a user type.
What I want to do is have a table called 'subscriptions', that after I process payment, it adds an entry to columns 'package_id' and 'employer_id'.
What I want to do ultimately is be able to do stuff like $employer->subscription->name, where the subscription table "acts" as a pivot table, hosting the relationship between employer and package.
The only problem is that this is not a many to many relationship. A package can belong to many different employers, except an employer can only have one subscription (so only one package)
Can any one help me implement this? Or at least tell me if this is even a logical approach. Better suggestions are welcome
Please or to participate in this conversation.