Closed igortrinidad closed 8 years ago
Hi everyone,
Same question as @igortrinidad. Is there a way to do this already?
Sorry, I don't understand your question. Do you have an example?
Hi Caleb,
Well we use the polymorphism that laravel provide to us, in some table we have messageable_id and messageable_type (it's the class of the model), so i'd like to know if the package could make the scope based on this two points (id and type) in the queries...
Cause we could have two or more id's that doesn't mean the same entity, could be some id of client, and manager whatever...
But till now we're doing this by hand actually...
Hmm I see.
In theory, you could set this up. I can't tell you what the logic would be to decide what values to use, as that's specific to your app, but you can set two "tenants":
Landlord::addTenant('messagable_id', $whatever);
Landlord::addTenant('messagable_type', $whatever);
Does that help?
Woww that's awesome! I never thought about it... oO
Thanks for your attention and to keep the project!
No problem. Good luck!
Hi guys,
Please, can you tell me how to make the scope of my queries with the package using polymorphism relationship?
Like how to set the type (tenant class) and the id (tenant id).
Thanks in advance!