-
Notifications
You must be signed in to change notification settings - Fork 79
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
Tokens support #277
Tokens support #277
Conversation
@ryanmitchell PR for supporting the preview tokens as we talked about. :) |
Awesome, thanks for this. I've added a PR to core for the cli install support: statamic/cms#9962 We're switching to default repositories |
This was dumb on my part. Since this PR is targeting Statamic 5, we can get a contract into core that you can bind to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once statamic/cms#9964 is merged, you should be able to do the mentioned changed.
Also, you'll probably need to adjust typehints.
Cool, will do. Thanks! |
All looks good to me, but I'll let Jason merge it as he was working with you on this. |
Adds token support so live preview tokens are stored in the database.
There are a couple of things that are out of the ordinary:
TokenRepository
contract, so we're just binding to the file repository class instead.make
method doesn't use the service container, so we have to override it.app(Token::class)::fromModel($model)
doesn't work due to the constructor arguments, so this just callsToken::fromModel($model)
directly.These probably require PRs to core if we want them to work like everything else.
Let me know if anything needs changing.
The new update script assumes this will be in 3.5.0.