Laravel Cloudflare
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).