-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BusinessCategory #23 #64
Conversation
@@ -12,7 +12,7 @@ public function up() | |||
{ | |||
Schema::create('business_category_place', function (Blueprint $table) { | |||
$table->id(); | |||
$table->foreignIdFor(app('business_category')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add this class to the tipoff/support config. Can you do a PR for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
Schema::create('business_category_place', function (Blueprint $table) { | ||
$table->id(); | ||
$table->foreignIdFor(\Tipoff\Seo\Models\BusinessCategory::class); | ||
$table->foreignIdFor(app('place')); | ||
$table->timestamps(); | ||
|
||
$table->unique(['business_category','place']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment here:
There should be a polymorphic relationship between business_categories and place_details and gmb_details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this business_category_place table should not exist. A new table for the polymorphic relationships should be created. I'm not sure what to call it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the -able? detailable or categorizable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, let's use categorizable. I don't know what the name of that table should be. Maybe businesscategory_records like we did in the tipoff/statuses pacakge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use the business_categories table and make it a morph for anything that needs a business category? Would just have name, categorizable_id, categorizable_type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I want that to be unique. I want to know what Business Categories are morphed to each. Not have 500 business categories for the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a location with a morphed business category, that will be unique to that model: categorizable_id=<location_id> categorizable_type='/tipoff/Locations/Models/Location', name=<gmb_category>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. I don't want it to be unique to the model. I want business_cateogries to be unique names and another model that will be unique to the model.
… for business category)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 👾
create BusinessCategory model, categories in migration; business_category_place join table migration; add relations to Place and BusinessCategory