1. Go to this page and download the library: Download aionphp/aion 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/ */
aionphp / aion example snippets
namespace App\Providers;
use Aion\Facades\Aion;
use App\Console\Commands\CleanupOrders;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\ServiceProvider;
final class AionServiceProvider extends ServiceProvider
{
public function boot(Schedule $schedule): void
{
Aion::register(
key: 'orders.cleanup',
event: $schedule
->command(CleanupOrders::class)
->dailyAt('03:00')
->withoutOverlapping()
->onOneServer(),
label: 'Clean up orders',
description: 'Clean up expired order state.',
);
}
}