saved, updated) to trigger cache purges, aligning with Laravel’s native architecture./posts/1) or full zone purges? The package defaults to zone purges.Cache Purge permissions.Cache Purge scope..env or secrets manager).composer require leknoppix/laravel-cloudflare
config/app.php.php artisan vendor:publish --provider="Leknoppix\LaravelCloudflare\LaravelCloudflareServiceProvider"
CLOUDFLARE_API_TOKEN in .env.cloudflare.php (e.g., zone ID, purge paths).PurgeCache trait or use events:
use Leknoppix\LaravelCloudflare\Traits\PurgeCache;
class Post extends Model {
use PurgeCache;
}
use Leknoppix\LaravelCloudflare\Facades\LaravelCloudflare;
LaravelCloudflare::purge('/posts/1');
saved, updated, deleted, etc. Custom events can be added via config.Post).published_at updates).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Cloudflare API downtime | Cache staleness | Fallback to manual purges or alerts. |
| Invalid API token | All purges fail | Monitor token validity. |
| Rate limit exceeded | Partial cache invalidation | Queue purges or reduce frequency. |
| Network issues | Silent failures | Log HTTP errors. |
| Laravel event system failure | Purges not triggered | Test event listeners. |
PurgeCache trait to models.How can I help you explore Laravel packages today?