2017 © Pedro Peláez
 

library laravel-cloudflare

Laravel framework Service Provider to automatic loading IP ranges of Cloudflare trust proxies.

image

lukasz-adamski/laravel-cloudflare

Laravel framework Service Provider to automatic loading IP ranges of Cloudflare trust proxies.

  • Tuesday, June 12, 2018
  • by lukasz-adamski
  • Repository
  • 0 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Cloudflare Trusted Proxy Service Provider for Laravel

The package is developed to provide Cloudflare trust proxies support for Laravel Framework requests. List of IP ranges used by Cloudflare can be found here: (https://www.cloudflare.com/ips/)., (*1)

Installation

  1. Install composer package using command:
composer require lukasz-adamski/laravel-cloudflare
  1. Add Service Provider in config/app.php:
Adams\Cloudflare\CloudflareServiceProvider::class,
  1. Add middleware to your project in app/Http/Kernel.php. You can put this middleware where you want but if project is hosted with Cloudfare Reverse Proxy it is preferable to register it for all requests in $middleware variable.
\Adams\Cloudflare\Moddleware\TrustProxies::class,
  1. Run artisan command to load fresh IPs from Cloudflare:
php artisan cloudflare:reload

Available commands

This package will not load Cloudflare IPs automatically. To do this you can use two registered commands: * cloudflare:reload - this command loads list of current Cloudflare Proxy IPs and store in application cache forever, * cloudflare:view - this command show list of loaded IPs from Cloudflare., (*2)

Automatic reloading

If you want automatic refreshing of Cloudflare IP ranges you can schedule cloudflare:reload command in your app. To do this open app/Console/Kernel.php and modify schedule function like this:, (*3)

/**
 * Define the application's command schedule.
 *
 * @param \Illuminate\Console\Scheduling\Schedule $schedule
 * @return void
 */
protected function schedule(Schedule $schedule)
{
    $schedule->command('cloudflare:reload')
        ->daily();
}

The Versions

12/06 2018

dev-master

9999999-dev

Laravel framework Service Provider to automatic loading IP ranges of Cloudflare trust proxies.

  Sources   Download

MIT

The Requires

 

by Łukasz Adamski

laravel framework proxy cloudflare proxies trust