2017 © Pedro Peláez
 

library laravel-client

The Laravel client package for LaraDNS - automating the DNS update process.

image

laradns/laravel-client

The Laravel client package for LaraDNS - automating the DNS update process.

  • Sunday, March 19, 2017
  • by laradns
  • Repository
  • 0 Watchers
  • 1 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 35 % Grown

The README.md

LaraDNS - Client

This is the client for users of LaraDNS that exposes a php artisan dns:sync console command which updates the IP address of a particular Cloudflare DNS record with that of the originating request., (*1)

Installation

As simple as it should be:, (*2)

Require it

composer require laradns/laravel-client

Configure it

Add your unique ID obtained after adding your site via the LaraDNS interface:, (*3)

// .env

LARADNS_ID=AJBUEo3UcmZ0JDPgSCGxwIRrj5TyAU

Add the LaraDNS service provider:, (*4)

// config/app.php

'providers' => [
    // Other service providers...    
    LaraDns\Providers\LaraDnsServiceProvider::class,
]

Run it

Schedule the command to execute as often, or as little, as you wish. As it's a console command, you can even include it in your deploy script to ensure your DNS is always up-to-date., (*5)

// App/Console/Kernel.php

protected function schedule(Schedule $schedule)
{
    $schedule->command('dns:sync')->everyFiveMinutes();
}

Events

You may wish to perform your own actions on an IP update. To facilitate this, the client fires an LaraDns\Events\SiteUpdated event each time an IP address changes, with the address as the payload., (*6)

Register a listener:, (*7)

// App/Providers/EventServiceProvider.php

protected $listen = [
    \LaraDns\Events\SiteUpdated::class => [
        \App\Listeners\SiteIpUpdated::class,
   ],
];

Handle the event:, (*8)

// App/Listeners/SiteIpUpdated.php

<?php

namespace App\Listeners;

class SiteIpUpdated
{
    public function __construct()
    {
        //
    }
    public function handle(\LaraDns\Events\SiteUpdated $event)
    {
        // $event->newIpAddress;
    }
}

Help and Contact

Please feel free to contact hello@laradns.com for any assistance and troubleshooting., (*9)

The Versions

19/03 2017

dev-master

9999999-dev

The Laravel client package for LaraDNS - automating the DNS update process.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andrew Lees

19/03 2017

v0.1

0.1.0.0

The Laravel client package for LaraDNS - automating the DNS update process.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andrew Lees