A Statamic addon for generating preview links for your entries. This addon allows you to create shareable links that include a token for previewing unpublished or draft content.
- Generate unique preview URLs for Statamic entries through a custom fieldtype.
- Configurable token expiration.
- Option to display a configurable preview mode banner at the top of the page.
-
Add the repository to your
composer.jsonfile:"repositories": [ { "type": "vcs", "url": "https://github.com/roxdigital/preview-link" } ]
-
Require the package through composer
composer require roxdigital/preview-link
-
After installation, publish the configuration file
php artisan vendor:publish --tag=preview-link-config
To generate a preview URL for an entry, add the custom fieldtype 'Preview link' to your blueprint. Browse to the entry in your /cp and click the button. The generated URL that it will copy will include a token that allows access to the preview through tokens stored in /storage/statamic/tokens.
Version 2.0.0 is used for Statamic 5, where version 1.0.0 can still be used for Statamic 4
This repo is based on the work of Tin Modric found here