Open davemathews opened 11 years ago
At the moment this is not supported, though thank you for bringing it up here so I can have an issue to point to. I've taken a cursory look at polymorphic relationships and (at first glace) it seems like it should be a simple enough thing to add. I'm trying to tackle other problems at the moment, so the best way to get this in would be a PR :)
I will take a look and see about fixing it for you. One option I did in L3 was to use filters by overriding the query method in my Model so I could use the same table within 4 different Admin configs pointing to different models. A good feature to add later would be the ability to push a filter key value pair to the query method of the model. Would need to define it in the Admin configs for the model.
Hello, I just wanted to ask whether there is anything going on in terms of polymorphic relations support, per your recent discussion? Regards,
Hi, do you have any plans to revive this issue? Any ideas/directions on how to customize it or help with the dev?
@bmtKIA6 it actually wouldn't be too difficult to implement. Polymorphic relationships are effectively the same as regular relationship, except with slightly different class names and a few other things. For example, I could probably extend the MorphTo
from BelongsTo
with only a few alterations. This is on the short list of things to get in, but I just need to find the time to get it going. There would also be a few html/js adjustments to make.
@janhartigan has there been any movement on getting administrator working with Poly-Morphic relationships?
+1
All the latest work is being done in the v5
branch. I'm definitely keeping polymorphs in mind as I build it out.
Brilliant, thanks very much for this! I hate giving it a +1 without a pr, but I simply have no time for that at the moment. If you're still working on it in a week or two, I'll try to help out. Thanks again!
Anyone have any time for this one?
Hi, has anybody come up with solution for this one? @davemathews could you provide more info about your quick solution with query filters? Thanks.
Any progress on this since April? I'd love to submit a PR, but this is just above my skill level at this time.
can somebody smarter than me use https://github.com/msurguy/laravel-seo (Laravel plymorphic admin SEO package) and roll it into this project?
+1 Hi guys, any update on this? Do you have a plan to introduce this to core?
+1 Just converted some code to use polymorphic relations, was disappointed to find out it's not supported in Administrator, which has been otherwise excellent. Any update on this?
Also interested in this as a feature
👍
So Laravel 4 has a great new addition called Polymorphic tables that allows you to log different models to the same table sharing resources using the morph relationships.
Have you played with this or is there a way we can use Polymorphic tables within the administrator?