-
Notifications
You must be signed in to change notification settings - Fork 41
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
your opinion for integration in existing app #43
Comments
with the pull request #44 I solve the problem of link from the ticket to my stuff |
Hi @fbollon, As a resume for your issue and using "Element" as a model example, you want to integrate PanicHD tickets with the "Element" model in your app with these requirements:
Are these points correct? Or am I missing something? |
this seems to me to be a good summary unless I make a translation error |
Hi @fbollon, In PR #44 you have created a Laravel eloquent polymorphic one to many relationship to cover your current needs, as we have pointed out in this issue. In the Laravel docs you may have already seen that the perfect example for this kind of relationship is a "Comment" model. If we have for example some publications in our app managed by the "Publication" model, where we may have comments, It would be really weird to have a single comment related to a Ticket and to a Publication, so this relationship would fit well. I think that a PanicHD "Ticket" as a concept may have a more general application manner than a "Comment". I will add some examples to clarify how actually can it be used:
I could add more examples to try to explain better what I mean. I would not use a One to Many Polymorphic relationship because It's not flexible enough for a growing Laravel app. Sooner or later, It will simply not be sufficient. Instead of this approach, why not creating a Many to Many kind of relationship? I think that your first comment in the issue was pointing in the right way and later in your PR you changed your mind. In fact, this kind of relationship will let you link a ticket to a single model if you want to, it's your decision. I deliberately said "kind of relationship" because i also think that the best approach for several Many to Many relationships with a single Ticket is to have a dedicated pivot table for each of them, instead of having a Laravel flavored mixed pivot table with a bunch of different relations in it. I've tested the polymorphic one but I'm not convinced of any advantage for it over the "traditional" one. Regarding to these URL additional parameters for the ticket creation in your PR #44 I recommend you a different approach to have this feature, that consists in:
I recommend also to think carefully the way you're going to implement these session variables, to ensure that they come form a concatenated event of 1. Element view 2. Ticket creation. This basically means to add some checking before using them and also don't forget to erase them when they're not needed anymore. |
Hello
I would like to have your opinion.
I would like to integrate panichd to an existing application that is used to manage stuff and from this stuff offer the possibility to create tickets and therefore have a link between this stuff and the associated tickets, to be able to list the tickets from the stuff and have a link in the tickets to the stuff.
I created a pivot table (ticket_id, stuff_id), I created a form in my application and I create the ticket as suggested in the wiki :
Then I insert a row in my pivot table.
The principle works, I can list the tickets created this way in my stuff.
But it will force me to rewrite a whole specific form and there will be the problem of the link from the ticket to my stuff ...
I thought that a solution would be to add two columns in the tickets table (linkable_type and linkable_id for example) and to be able to fill them in hidden fields of the ticket creation form by passing them in parameter when calling the form.
What do you think about it?
Any other ideas?
The text was updated successfully, but these errors were encountered: