Skip to content

Conversation

@ryanmitchell
Copy link
Contributor

@ryanmitchell ryanmitchell commented Feb 17, 2022

Sorry for the duplication of PRs here but I have reached out to the authors of both the previous PRs to try and combine efforts but have had no response from either.

As I indicated here I have taken the existing PR (#20) and added the rest of the models. I subsequently discovered the work that has since been opened in #41 and have added the additional blueprints and field sets work from it.

I have intentionally not included user groups and role as IMO they should be handled by Statamic core as part of the eloquent users setup. Update: I've opened a PR in statamic/cms for this: statamic/cms#5686

So to confirm this PR includes:

  • taxonomies
  • navigations
  • globals
  • collections
  • form submissions
  • asset containers
  • assets meta
  • blueprints
  • field sets
  • revisions

I have also refactored the code allow for devs to opt in via config to each 'model', I have ensured it uses the bound models, and I have written console import tasks to allow migration from file based data to eloquent.

Finally I have applied fixes from any open PRs and ensured they are included (with the exception of Jason's).

@jasonvarga I'd appreciate it if you could review this and let me know what you think.

@crackAT
Copy link

crackAT commented Aug 29, 2022

Hei,
got an issue when importing assets with php please eloquent:import-assets

Undefined array key "last_modified"

at vendor/statamic/eloquent-driver/src/Assets/Asset.php:76
72▕ ])->fill(['data' => $meta]);
73▕
74▕ // Set initial timestamps.
75▕ if (empty($model->created_at)) {
➜ 76▕ $model->created_at = $meta['last_modified'];
77▕ $model->updated_at = $meta['last_modified'];
78▕ }
79▕
80▕ $model->save();

@ryanmitchell
Copy link
Contributor Author

ryanmitchell commented Aug 29, 2022 via email

@FrittenKeeZ
Copy link
Contributor

FrittenKeeZ commented Sep 1, 2022

What are we missing to get this merged?
Edit: Just noticed the link to Runway returns 404 - should be https://statamic.com/addons/duncanmcclean/runway

@jasonvarga jasonvarga merged commit bba3c81 into statamic:master Sep 1, 2022
@ryanmitchell ryanmitchell deleted the fixes-to-all-models-pr branch September 1, 2022 18:31
@jasonvarga
Copy link
Member

jasonvarga commented Sep 1, 2022

Thank you @ryanmitchell and everyone else involved in this. It's hugely appreciated. 🎉

Sorry for the delay on getting this merged.

For anyone already using this PR, keep in mind at the last moment that the config file was changed from eloquent_driver.php to eloquent-driver.php. You'll want to rename that.

I'm fine with the tests being duplicated for the moment. In the future maybe we can figure out a way to get the cms test suite running using this driver. No sense in holding this back any longer. It's working well enough for people to be using it in production.

@FrittenKeeZ
Copy link
Contributor

@jasonvarga awesome! I've already spotted a few typos, and the project could do with a Pint cleanup, but other than that I just need statamic/cms#5686 to be flying :D

@ryanmitchell
Copy link
Contributor Author

Amazing. Thanks to everyone for the contributions, testing and feedback!

@jackmcdade
Copy link
Member

jackmcdade commented Sep 1, 2022

Just wanted to share my heartfelt thanks for all the hard work from everyone on this PR – I made this video for you!

@espenlg
Copy link

espenlg commented Sep 1, 2022

Great news! If I may ask - what would be the proper way to change from using the PR to the master repo? I tried doing a normal install, removed the vcs-part in composer.json and renamed eloquent-driver.php, but that did not play well.

@ryanmitchell
Copy link
Contributor Author

Great news! If I may ask - what would be the proper way to change from using the PR to the master repo? I tried doing a normal install, removed the vcs-part in composer.json and renamed eloquent-driver.php, but that did not play well.

Remove my repo from your composer.json and then composer require statamic/eloquent-driver

@okaufmann
Copy link

Howly! I was so looking forward to this moment 🎉.

When I began 16 months ago, I've thought this would become a big thing to finish. Together, we have done it!

Many thanks to @ryanmitchell for keeping it going and managing it. And of course all the others who made this PR finally ready to be merged.

✌️

@Crasheng
Copy link

Crasheng commented Sep 4, 2022

Great News ppl, thanks for the merge

@GioChocolateBro
Copy link

Been following along the progress for some time, can't wait to plug this into my next project.

Great effort and much love to everyone involved! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.