Skip to content

jjjrmy/Laravel-Cloudflare

 
 

Repository files navigation

Laravel Cloudflare

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

About

The Cloudflare API right from Laravel.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%