laradns/laravel-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laradns/laravel-client

Composer 安装命令:

composer require laradns/laravel-client

包简介

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

README 文档

README

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.

Installation

As simple as it should be:

Require it

composer require laradns/laravel-client

Configure it

Add your unique ID obtained after adding your site via the LaraDNS interface:

// .env

LARADNS_ID=AJBUEo3UcmZ0JDPgSCGxwIRrj5TyAU

Add the LaraDNS service provider:

// 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.

// 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.

Register a listener:

// App/Providers/EventServiceProvider.php

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

Handle the event:

// 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.

统计信息

  • 总下载量: 63
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固