PHP code example of drag-and-publish / ip2location-sync
1. Go to this page and download the library: Download drag-and-publish/ip2location-sync 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/ */
drag-and-publish / ip2location-sync example snippets
namespace App\Console;
use DragAndPublish\Ip2locationSync\Jobs\Ip2LocationDownloadJob;
use DragAndPublish\Ip2locationSync\Jobs\Ip2LocationSyncJob;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
$schedule->job(Ip2LocationDownloadJob::class)->dailyAt('00:00');
$schedule->job(Ip2LocationSyncJob::class)->dailyAt('00:00');
}
}