I want to discuss a non-code related issue. Rather it's an issue with the concept or data model itself.
I am building a business directory website using Laravel.
I have made a packages
table, implemented packages CRUD functionality for the back-end and implemented a packages list, with sign-up buttons for the front-end. When a sign-up button is pressed, the package ID is passed to the sign-up route.
I have added package_id
as a foreign key to the users
table. But the issue I have now, is that if a user goes directly to the sign-up route, there is no package ID. I therefore would like to sign the user up for a free package.
I can't use a LIKE
query because of dynamic packages and can be changed the name and id as well if free package is deleted and again added and how to handle exception if free package was deleted.
Please help me with better methodology.