https://github.com/antonioribeiro/twill-edge-purge
A Twill Capsule to Handle Edge Cache purges
https://github.com/antonioribeiro/twill-edge-purge
Last synced: 3 months ago
JSON representation
A Twill Capsule to Handle Edge Cache purges
- Host: GitHub
- URL: https://github.com/antonioribeiro/twill-edge-purge
- Owner: antonioribeiro
- License: apache-2.0
- Created: 2024-01-15T11:03:04.000Z (almost 2 years ago)
- Default Branch: 1.x
- Last Pushed: 2024-01-29T15:24:54.000Z (over 1 year ago)
- Last Synced: 2025-02-24T03:23:41.927Z (8 months ago)
- Language: PHP
- Size: 1.94 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Edge Purge Twill Capsule
This Twill Capsule is intended to enable developers handle Edge cache purges.
## Screenshots
### Features on Twill

## Installing
### Require the Composer package:
``` bash
composer require area17/twill-edge-purge
```### Publish the configuration
``` bash
php artisan vendor:publish --provider="A17\TwillEdgePurge\ServiceProvider"
```## Enabling
This package is disabled by default. To enable it you just need to add to `.env`:
```dotenv
TWILL_EDGE_PURGE_ENABLED=true
```And set some user allowed roles:
```dotenv
TWILL_EDGE_PURGE_ALLOWED_ROLES=SUPERADMIN,ADMIN
```## Add to the user menu
In order to show the "Flush CDN" menu option, add the directive below to the `_user.blade.php` file:
```blade
@TwillEdgPurgeUserMenu
```## Configure the CDN service
```dotenv
# Twill Edge Purge
TWILL_EDGE_PURGE_SERVICE=cloudfront# CloudFront configuration
CLOUDFRONT_KEY=
CLOUDFRONT_SECRET=
CLOUDFRONT_DISTRIBUTION=
CLOUDFRONT_REGION=eu-west-1
```## CDN Sevices
All CDN Services configurations are deferred to the `config/services.php` file. You can copy here the ones that you will use:```php
'cloudfront' => [
'key' => env('CLOUDFRONT_KEY', env('AWS_ACCESS_KEY_ID')),
'secret' => env('CLOUDFRONT_SECRET', env('AWS_SECRET_ACCESS_KEY')),
'sdk_version' => env('CLOUDFRONT_SDK_VERSION', env('AWS_SDK_VERSION', '2017-10-30')),
'region' => env('CLOUDFRONT_REGION', env('AWS_DEFAULT_REGION', 'us-east-1')),
'distribution' => env('CLOUDFRONT_DISTRIBUTION', env('AWS_CLOUDFRONT_DISTRIBUTION')),
],
```## Adding checkbox to the edit page sidebar
Import the FormSideBar trait into your Controller:```php
use A17\TwillEdgePurge\Behaviours\FormSideBar;class ArticleController extends BaseModuleController
{
use FormSideBar;
```## Setting up the repository to purge after save
Import the asldklaksd trait into your repository```php