PHP code example of tkachikov / chronos
1. Go to this page and download the library: Download tkachikov/chronos 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/ */
tkachikov / chronos example snippets
return [
'domain' => env('CHRONOS_DOMAIN'),
'middlewares' => [
'web',
'auth',
// 'Tkachikov\Chronos\Http\Middleware\Authorize',
],
];
return [
'domain' => env('CHRONOS_DOMAIN'),
'middlewares' => [
'web',
'auth',
'Tkachikov\Chronos\Http\Middleware\Authorize',
],
];
// ...
class ChronosServiceProvider extends ChronosApplicationServiceProvider
{
// ...
protected function gate(): void
{
Gate::define('viewChronos', function ($user) {
return $user->hasRole('admin');
});
}
}
// ...
use Tkachikov\Chronos\Attributes\ChronosCommand;
#[ChronosCommand(
notRunInManual: false,
notRunInSchedule: true,
)]
class TestCommand extends Command
{
// ...
}
// ...
class TestCommand extends Command
{
use ChronosRunnerTrait;
// ...
}
// ...
use Tkachikov\Chronos\Attributes\ChronosCommand;
#[ChronosCommand(
group: 'MyGroup',
)]
class TestCommand extends Command
{
// ...
}
shell
php artisan chronos:install