teakowa / laravel-cloudflare
Use the Cloudflare API right from Laravel.
Requires
- php: ^7.2
- cloudflare/sdk: ^1.1.6
- illuminate/support: ^5.5 || ^6.0 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^7.5 || ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-11-13 15:07:21 UTC
README
The Cloudflare API right from Laravel.
Note: This will work for anything Laravel 5 and up but I made it for Laravel 5.5 so I won't add the service provider and facade instructions here.
Installation
First of all, You need get your API key (not token) from Cloudflare
composer require Teakowa/laravel-cloudflare
Publish the config file.
php artisan vendor:publish
Put them in your .env
as the following, obviously and respectively.
CLOUDFLARE_EMAIL
CLOUDFLARE_API_KEY
Usage
Lastly, you can using Cloudflare
class in controller use namespace top of that file
use Teakowa\Cloudflare\Cloudflare; $data = (new Cloudflare)->zone()->listZones();
or if you want a simple, you can use cloudflare
function:
cloudflare()
LICENSE
The code in this repository, unless otherwise noted, is under the terms of both the Anti 996 License and the Apache License (Version 2.0).