Download the PHP package monicahq/laravel-cloudflare without Composer

On this page you can find all versions of the php package monicahq/laravel-cloudflare. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-cloudflare

Trust Cloudflare's Proxies for Laravel

Add Cloudflare ip addresses to trusted proxies for Laravel.

Latest Version Downloads Workflow Status Quality Gate Coverage Status

Installation

  1. Install package using composer:

  2. Configure Middleware

Replace TrustProxies middleware in your bootstrap/app.php file:

Custom proxies callback

You can define your own proxies callback by calling the LaravelCloudflare::getProxiesUsing() to change the behavior of the LaravelCloudflare::getProxies() method. This method should typically be called in the boot method of your AppServiceProvider class:

How it works

The middleware uses Illuminate\Http\Middleware\TrustProxies as a backend.

When the cloudflare ips are detected, they are used as trusted proxies.

Refreshing the Cache

This package retrieves Cloudflare's IP blocks, and stores them in cache. When request comes, the middleware will get Cloudflare's IP blocks from cache, and load them as trusted proxies.

You'll need to refresh the cloudflare cache regularely to always have up to date proxy.

Use the cloudflare:reload artisan command to refresh the IP blocks:

Suggestion: add the reload command in the schedule

Add a schedule to your routes/console.php file to refresh the cache, for instance:

View current Cloudflare's IP blocks

You can use the cloudflare:view artisan command to see the cached IP blocks:

Option: publish the package config file

If you want, you can publish the package config file to config/laravelcloudflare.php:

This file contains some configurations, but you may not need to change them normally.

Running tests for your package

When running tests for your package, you generally don't need to get Cloudflare's proxy addresses. You can deactivate the Laravel Cloudflare middleware by adding the following environment variable in your .env or phpunit.xml file:

Compatibility

Laravel monicahq/laravel-cloudflare
5.x-6.x <= 1.8.0
7.x-8.53 2.0.0
>= 8.54 >= 3.0.0

Citations

This package was inspired by lukasz-adamski/laravel-cloudflare and forked from ogunkarakus/laravel-cloudflare.

License

Author: Alexis Saettler

This project is part of MonicaHQ.

Copyright © 2019–2024.

Licensed under the MIT License. View license.


All versions of laravel-cloudflare with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
illuminate/support Version ^8.0 || ^9.0 || ^10.0 || ^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package monicahq/laravel-cloudflare contains the following files

Loading the files please wait ....