PHP code example of laradns / laravel-client

1. Go to this page and download the library: Download laradns/laravel-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laradns / laravel-client example snippets


// .env

LARADNS_ID=AJBUEo3UcmZ0JDPgSCGxwIRrj5TyAU

// config/app.php

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

// App/Console/Kernel.php

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

// App/Providers/EventServiceProvider.php

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


// App/Listeners/SiteIpUpdated.php



namespace App\Listeners;

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