Download the PHP package fuelviews/laravel-cloudflare-cache without Composer

On this page you can find all versions of the php package fuelviews/laravel-cloudflare-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-cloudflare-cache

Laravel Cloudflare Cache

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads PHP Version Laravel Version

A powerful and intuitive Laravel package for managing Cloudflare cache purging directly from your Laravel application. Streamline your cache management workflow with comprehensive commands, validation, and seamless integration.

๐Ÿ“‹ Requirements

๐Ÿš€ Installation

Install the package via Composer:

Quick Setup

Run the install command for guided setup:

This will:

Manual Setup

Alternatively, you can manually publish the configuration:

โš™๏ธ Configuration

Environment Variables

Add your Cloudflare credentials to your .env file:

Getting Your Cloudflare Credentials

  1. API Key: Create an API token at Cloudflare API Tokens

    • Use the "Custom token" option
    • Required permissions: Zone:Zone:Read, Zone:Cache Purge:Edit
    • Zone Resources: Include specific zones or all zones
  2. Zone ID: Find your Zone ID in your Cloudflare dashboard
    • Go to your domain overview
    • Find "Zone ID" in the right sidebar
    • It's a 32-character hexadecimal string

Configuration File

The published configuration file config/cloudflare-cache.php:

๐ŸŽฏ Basic Usage

Using the Facade

Using Dependency Injection

Environment-Aware Functionality

The package includes smart environment detection:

The ive() method returns true when:

๐Ÿ› ๏ธ Artisan Commands

Cache Clear Command

Purge all Cloudflare cache:

Success Output:

Error Output:

Validate Configuration

Check your configuration for issues:

Successful validation:

With errors:

Check Status

Test your API connection and configuration:

Successful status check:

With configuration issues:

๐ŸŽ›๏ธ Advanced Usage

Integration with Events

Clear cache automatically when content changes:

Using in Queue Jobs

For better performance, queue cache purging operations:

Custom Service Provider

Publish and customize the service provider:

This publishes CloudflareCacheServiceProvider to your app/Providers directory for customization.

Middleware Integration

Create middleware to automatically purge cache:

๐Ÿ›ก๏ธ Exception Handling

The package provides comprehensive error handling:

๐Ÿงช Testing

Running Package Tests

Testing in Your Application

The package automatically handles testing environments:

Feature Testing

๐Ÿ› Troubleshooting

Common Issues

โŒ "API Key not configured"

โŒ "Zone ID format appears invalid"

โŒ "Request error: Invalid API Token"

โŒ "Request error: Zone not found"

Debug Mode

Enable debug mode for detailed information:

With debug mode enabled:

Validation Commands

Use built-in validation to diagnose issues:

Logging

Check Laravel logs for detailed error information:

๐Ÿ“š API Reference

CloudflareCacheInterface

purgeEverything(): bool|string

Purges all cache from Cloudflare for the configured zone.

Returns:

Throws:

ive(): bool

Determines if cache purging should be performed based on environment and configuration.

Returns:

Available Commands

Command Description
cloudflare-cache:install Guided installation process
cloudflare-cache:clear Purge all Cloudflare cache
cloudflare-cache:validate Validate configuration settings
cloudflare-cache:status Check API connection and configuration

๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Development Setup

๐Ÿ“„ Changelog

Please see CHANGELOG for more information on what has changed recently.

๐Ÿ” Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

๐Ÿ‘จโ€๐Ÿ’ป Credits

๐Ÿ“œ License

The MIT License (MIT). Please see License File for more information.


Built with โค๏ธ by the Fuelviews team

โญ Star us on GitHub โ€ข ๐Ÿ“ฆ View on Packagist


All versions of laravel-cloudflare-cache with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^10.0||^11.0||^12.0
spatie/laravel-package-tools Version ^1.92
guzzlehttp/guzzle Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fuelviews/laravel-cloudflare-cache contains the following files

Loading the files please wait ....