FrozenNode / Laravel-Administrator

An administrative interface package for Laravel
http://administrator.frozennode.com/
MIT License
1.94k stars 503 forks source link

Polymorphic Tables #191

Open davemathews opened 11 years ago

davemathews commented 11 years ago

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?

janhartigan commented 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 :)

davemathews commented 11 years ago

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.

Gadoma commented 11 years ago

Hello, I just wanted to ask whether there is anything going on in terms of polymorphic relations support, per your recent discussion? Regards,

bmtKIA6 commented 11 years ago

Hi, do you have any plans to revive this issue? Any ideas/directions on how to customize it or help with the dev?

janhartigan commented 11 years ago

@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.

davemathews commented 10 years ago

@janhartigan has there been any movement on getting administrator working with Poly-Morphic relationships?

BenjaminRH commented 10 years ago

+1

janhartigan commented 10 years ago

All the latest work is being done in the v5 branch. I'm definitely keeping polymorphs in mind as I build it out.

BenjaminRH commented 10 years ago

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!

that0n3guy commented 10 years ago

Anyone have any time for this one?

zub0r commented 10 years ago

Hi, has anybody come up with solution for this one? @davemathews could you provide more info about your quick solution with query filters? Thanks.

mandofever78 commented 9 years ago

Any progress on this since April? I'd love to submit a PR, but this is just above my skill level at this time.

mandofever78 commented 9 years ago

can somebody smarter than me use https://github.com/msurguy/laravel-seo (Laravel plymorphic admin SEO package) and roll it into this project?

makowskid commented 8 years ago

+1 Hi guys, any update on this? Do you have a plan to introduce this to core?

Jonathan3Harris commented 8 years ago

+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?

timbroder commented 8 years ago

Also interested in this as a feature

👍