corcel / acf

Advanced Custom Fields (ACF) plugin for Corcel
128 stars 100 forks source link

Updated & maintained fork #74

Open tbruckmaier opened 5 years ago

tbruckmaier commented 5 years ago

Since development seems not be very active here, I created a fork (actually a complete rewrite): https://github.com/tbruckmaier/corcel-acf

This fork uses eloquent relations to retrieve the acf fields, which massively increases performance. There is also support for option pages, unknown field types, complicated layouts like an image in a repeater in a felxible content, etc.

I use this package in several live websites already, so it will be maintained in the future. Looking forward to feedback!

tbruckmaier commented 5 years ago

@jgrossi if you do not intend to continue this package anymore, you might consider putting a link to the fork into the readme?

jgrossi commented 5 years ago

@tbruckmaier hey thanks for sharing! instead of forking this I can add you as a member, then you can help me to approve PRs... and you are also welcome to send yours too.. they are very welcome.. and if you did a complete rewrite you're also welcome to share it as well ;-) thank you for the hard work!

jgrossi commented 5 years ago

Corcel (core) was completely rewritten in 2017, and we are moving to a version 3 soon, a completely framework-agnostic package, with Eloquent and Doctrine support as well... you're also welcome to join these next changes... so I guess you have good work to share with the main repository...

you're welcome to send a PR or even help me to make this working.. thanks!

moazam1 commented 5 years ago

@jgrossi when do you plan to release new version? Is there any plan for auto generate layout like ACF? Thanks for the hard work!

tbruckmaier commented 5 years ago

@jgrossi where can i find the corcel rewrite? Is there a special branch? Maybe I'm just blind ;)

Regarding the acf package: as my fork works quite differently than your original package, I don't think we should merge it back into this repository. Or we should increase the version number at least

jgrossi commented 5 years ago

@tbruckmaier Corcel now follows Laravel versions, like 2.8 -> Laravel 5.8. this was done in 2017, and the ACF plugin was developed when Corcel was 1.0. it works with the current version, but it's not designed to match Corcel's versions schema.

can you explain more how your's version works differently from the original one? thanks

jgrossi commented 5 years ago

@moazam1 just released 1.1.1 matching the develop branch. about the auto generate layout, if you give me more information about it, we can work together to make that feature available

moazam1 commented 5 years ago

@jgrossi thanks so much. The idea is same as ACF renders and validate forms on CPT and options page, we can do same on Laravel end using Laravel forms. Let's say user place a json file in a acf-json directory and then we can render form using the json file exactly same as ACF. I noticed that tab field is missing here: https://github.com/corcel/acf#fields I know it does nothing but will be cool for presentation purpose.

tbruckmaier commented 5 years ago

@jgrossi i rewrote the field fetching mechanism with a custom eloquent relation, so it is possible now for instance to preload relations with with() and load(). The relation uses the meta data from the post object, so there are no further queries needed for any acf fields of one post. Any that gives a number of advantages:

codemonkeynorth commented 4 years ago

@tbruckmaier would be great if this could work without Laravel (first issue i hit was with config() function)

I'm actually testing out Corcel within just Wordpress itself, to use the Models for Custom Post Types etc, so I'm not using the Laravel side of it at all

I found your version because this corcel/acf version currently doesn't support Group fields

I'm having to use the older version though because of other dependencies

"jgrossi/corcel": "2.8",
"corcel/acf": "^1.1.1",
"tbruckmaier/corcel-acf": "^1.3"
tbruckmaier commented 4 years ago

@codemonkeynorth Hi, I have not planned for such a usage, but it could probably be implemented. I created an issue at https://github.com/tbruckmaier/corcel-acf/issues/7 and commented there