All Projects β†’ sebdesign β†’ artisan-cloudflare

sebdesign / artisan-cloudflare

Licence: MIT license
Laravel artisan commands for CloudFlare

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to artisan-cloudflare

artisan-shortcuts
🍰 Register shortcuts to execute multiple artisan commands
Stars: ✭ 56 (-16.42%)
Mutual labels:  laravel-package, artisan
Laravel Opcache
Laravel Package for OPcache
Stars: ✭ 1,116 (+1565.67%)
Mutual labels:  laravel-package, artisan
Generator
Laravel 5.3+ Scaffold Generator, Support both bootstrap and Semantic UI
Stars: ✭ 327 (+388.06%)
Mutual labels:  laravel-package, artisan
laravel-migrate-check
An artisan command to check for pending migrations with proper exit code
Stars: ✭ 53 (-20.9%)
Mutual labels:  laravel-package, artisan
Blade Migrations Laravel
An intelligent alternative version of Laravel 5/6 Database Migrations - uses raw-sql syntax, transactions, auto-rollback, UP-DOWN-UP testing
Stars: ✭ 25 (-62.69%)
Mutual labels:  laravel-package, artisan
artisan-remote
Artisan Remote is a package for Laravel to interact with your Artisan Commands via an HTTP API.
Stars: ✭ 69 (+2.99%)
Mutual labels:  laravel-package, artisan
cj-temporal-models
No description or website provided.
Stars: ✭ 29 (-56.72%)
Mutual labels:  laravel-package
laravel-live-tinker
Laravel tinker in your browser with code highlight
Stars: ✭ 51 (-23.88%)
Mutual labels:  artisan
laravel-viva-payments
A Laravel package for integrating the Viva Payments gateway
Stars: ✭ 29 (-56.72%)
Mutual labels:  laravel-package
CloudflareSpeedTest
πŸŒ©γ€Œθ‡ͺι€‰δΌ˜ι€‰ IP」桋试 Cloudflare CDN ε»ΆθΏŸε’Œι€ŸεΊ¦οΌŒθŽ·ε–ζœ€εΏ« IP (IPv4 / IPv6)οΌε¦ε€–δΉŸζ”―ζŒε…Άδ»– CDN / 网站 IP ~
Stars: ✭ 5,092 (+7500%)
Mutual labels:  cloudflare
cf ddns
CloudFlare DDNS executable written in Swift
Stars: ✭ 20 (-70.15%)
Mutual labels:  cloudflare
nova-url-field
A URL input and link field for Laravel Nova
Stars: ✭ 96 (+43.28%)
Mutual labels:  laravel-package
cup
CUP - Cloudflare (DNS) Updater Program
Stars: ✭ 30 (-55.22%)
Mutual labels:  cloudflare
laravel-easyblade
Create an easier & readable Blade (view) in Laravel with EasyBlade
Stars: ✭ 64 (-4.48%)
Mutual labels:  laravel-package
relay-starter-kit
πŸ’₯ Monorepo template (seed project) pre-configured with GraphQL API, PostgreSQL, React, Relay, Material UI.
Stars: ✭ 3,513 (+5143.28%)
Mutual labels:  cloudflare
track-who
Laravel Traits for tracking who's done what to your models
Stars: ✭ 29 (-56.72%)
Mutual labels:  laravel-package
LaraPersonate
Login as a different user quickly
Stars: ✭ 121 (+80.6%)
Mutual labels:  laravel-package
behindflare
This tool was created as a Proof of Concept to reveal the threats related to web service misconfiguration using CloudFlare as reverse proxy and WAF
Stars: ✭ 14 (-79.1%)
Mutual labels:  cloudflare
DnsTube
Access your computer from anywhere. DnsTube is a Windows .NET dynamic DNS client for Cloudflare.
Stars: ✭ 137 (+104.48%)
Mutual labels:  cloudflare
laratify
Laravel UI Components using TailwindCSS & AlpineJS
Stars: ✭ 13 (-80.6%)
Mutual labels:  laravel-package

Laravel artisan commands for Cloudflare

Latest Version on Packagist Software License Build Status Quality Score Scrutinizer Coverage StyleCI

Laravel artisan commands for interacting with the CloudFlare API.

artisan-cloudflare.png

Installation

You can install the package via composer. This package requires Laravel 5.5 or higher.

composer require sebdesign/artisan-cloudflare

Since version 5.5, Laravel uses package auto-discovery, so doesn't require you to manually add the ServiceProvider. If you don't use auto-discovery or you are using an older version, add the service provider in config/app.php.

<?php

'providers' => [
    Sebdesign\ArtisanCloudflare\ServiceProvider::class,
],

Configuration

Publish the config file in config/cloudflare.php.

To authenticate with an API key set CLOUDFLARE_KEY and CLOUDFLARE_EMAIL in the .env.

Otherwise you can use an API token by setting the CLOUDFLARE_TOKEN in the .env.

php artisan vendor:publish --provider="Sebdesign\ArtisanCloudflare\ServiceProvider"

The following options are available:

<?php

return [
    /**
     * API token generated from the User Profile 'My Profile > Api Tokens > API Tokens' page.
     * create token > Edit zone DNS > "Permissions" Zone:Cache Purge:Purge
     */
    'token' => env('CLOUDFLARE_TOKEN'),

    /**
     * Global API Key on the "My Profile > Api Tokens > API Keys" page.
     */
    'key' => env('CLOUDFLARE_KEY'),

    /**
     * Email address associated with your account.
     */
    'email' => env('CLOUDFLARE_EMAIL'),

    /**
     * Array of zones.
     *
     * Each zone must have its identifier as a key. The value is an
     * associated array with *optional* arrays of files and/or tags.
     *
     * you can find your zoneId under 'Account Home > site > Api'.
     *
     * E.g.
     *
     * '023e105f4ecef8ad9ca31a8372d0c353' => [
     *      'files' => [
     *          'http://example.com/css/app.css',
     *      ],
     *      'tags' => [
     *          'styles',
     *          'scripts',
     *      ],
     *      'hosts' => [
     *          'www.example.com',
     *          'images.example.com',
     *      ],
     * ],
     */
    'zones' => [
        //
    ],
];

Usage

Read more about Purging cached resources from Cloudflare on the support article.

Execute the cloudflare:cache:purge command in your console or integrate it in your deployment workflow.

Purge all the zones with their files and tags.

php artisan cloudflare:cache:purge

Purge a single zone.

If the zone exists in the config, then its files and tags will be purged. Otherwise everything will be purged from the given zone.

php artisan cloudflare:cache:purge 023e105f4ecef8ad9ca31a8372d0c353

Purge individual files from all the zones.

php artisan cloudflare:cache:purge --file="http://example.com/css/app.css" --file="http://example.com/img/logo.svg"

Purge individual tags from all the zones.

Purging tags is available for Enterprise accounts only.

php artisan cloudflare:cache:purge --tag=styles --tag=scripts

Purge individual hosts from all the zones.

Purging hosts is available for Enterprise accounts only.

php artisan cloudflare:cache:purge --host=www.example.com --host=images.example.com

Purge individual files, tags, and hosts from all the zones.

php artisan cloudflare:cache:purge --file="http://example.com/css/app.css" --tag=scripts --tag=images --host=www.example.com

Purge individual files, tags, and hosts from a single zone.

php artisan cloudflare:cache:purge 023e105f4ecef8ad9ca31a8372d0c353 --file="http://example.com/css/app.css" --tag=scripts --tag=images --host=www.example.com

Changelog

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

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].