Download the PHP package joshuapack/laravel-cloudflare without Composer
On this page you can find all versions of the php package joshuapack/laravel-cloudflare. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download joshuapack/laravel-cloudflare
More information about joshuapack/laravel-cloudflare
Files in joshuapack/laravel-cloudflare
Package laravel-cloudflare
Short Description Use the Cloudflare API for Laravel 10-12 using PHP >= 8.1.
License MIT
Homepage https://github.com/joshuapack/laravel-cloudflare
Informations about the package laravel-cloudflare
Laravel Cloudflare
The Cloudflare API for Laravel 10-12
How to Install
First do composer require joshuapack/laravel-cloudflare
Get the following information.
- Your Cloudflare email, simple, the one you use to log in with.
- Your Cloudflare API Key, found in your account settings.
- The Zone ID for the domain you want to edit, this is on the main page for the domain.
Put them in your .env
as the following, obviously and respectively.
CLOUDFLARE_EMAIL
, the legacy way, must be provided withCLOUDFLARE_API_KEY
.CLOUDFLARE_API_KEY
, the legacy way, must be provided withCLOUDFLARE_EMAIL
.CLOUDFLARE_API_TOKEN
, the preferred way, no email or key required. Create a token.CLOUDFLARE_ZONE_ID
, optional.
How to use
There is a Facade CloudFlare
You can also use $cf = app()->make('laravel-cloudflare')
Then use $cf
to make the calls like $cf->setZoneId('12312312312312312312323')
For example, you could then list the records like so
$cf->listRecords()
Which would return a collection of your records for that zone.
Current Getters/Setters
zoneId
Current Methods
listZones
addRecord
listRecords
getRecordDetails
updateRecordDetails
deleteRecord
Direct Queries
You can see all API calls [https://github.com/cloudflare/cloudflare-php] for direct querying, however, we only have a couple available at this time.
queryDNS
queryFirewall
queryFirewallSettings
queryZones
queryZoneSettings
Query Any Cloudflare Endpoint from SDK
You can now direct all API calls from the SDK [https://github.com/cloudflare/cloudflare-php]. Use the queryCloudflare()
method. See wiki for examples and more details [https://github.com/joshuapack/laravel-cloudflare/wiki/Query-Cloudflare]
Questions
If you have any questions feel free to ask in the issues tab on github. Same with adding more direct queries or other methods.