1. Go to this page and download the library: Download meisendev/laravel-daemon 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/ */
meisendev / laravel-daemon example snippets
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
TestDaemon1::class,
\Meisendev\LaravelDaemon\DaemonSentinelCommand::class,
];
}
return [
'test:daemon:1' => [
'name' => 'test:daemon:1',//regular Artisan command signature, note: the name without args
'once' => false,//run only once? if not, command will restart upon previous execution ends
'parallel' => 5,//how many parallel
'args' => [//regular Artisan command args like: 'test:daemon:1 {arg1} {arg2}'
'arg1' => 'test1',
'arg2' => 'test11'
],
'interval' => 3,//minimum number of seconds between last end and next start
'alert' => true
],
'test:daemon:2' => [
'name' => 'test:daemon:2',
'once' => true,
'parallel' => 8,
'args' => [
'arg1' => 'test2'
],
'frequency' => '3',//minimum seconds between two start
'alert' => true
]
];
shell
php artisan sentinel:run meisendev
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.