PHP code example of ericychu / forsun-laravel

1. Go to this page and download the library: Download ericychu/forsun-laravel 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/ */

    

ericychu / forsun-laravel example snippets


php artisan vendor:publish --provider="Snower\LaravelForsun\ServiceProvider"

// 注册 Service Provider
$app->register(Snower\LaravelForsun\ServiceProvider::class);

// 注册 Facade
$app->withFacades(true, [
    ...,
    Snower\LaravelForsun\Facade::class => 'Forsun',
]);

cp /PROJECT_DIRECTORY/vendor/ericychu/forsun-laravel/src/config.php /PROJECT_DIRECTORY/config/forsun.php

#注册
php artisan forsun:schedule:register

#取消注册
php artisan forsun:schedule:unregister