teakowa/laravel-cloudflare

Use the Cloudflare API right from Laravel.

v1.1.1 2020-10-24 17:46 UTC

This package is auto-updated.

Last update: 2024-12-13 15:17:22 UTC


README

The Cloudflare API right from Laravel.

Travis (.org) StyleCI PHP from Packagist Packagist Version LICENSE LICENSE 996.icu

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.

  1. CLOUDFLARE_EMAIL
  2. 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).