PHP code example of interwal-net / filament-visual-cron-builder

1. Go to this page and download the library: Download interwal-net/filament-visual-cron-builder 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/ */

    

interwal-net / filament-visual-cron-builder example snippets


use InterwalNet\CronBuilder\CronBuilder;

CronBuilder::make('schedule')
    ->showNextRun()      // toggle the next-run preview (default: from config)
    ->layout('tabs')     // 'grid' (default) or 'tabs'; default from config
    ->showTabTokens()    // tabs only: show each position's cron token in its tab
    ->

CronBuilder::make('schedule')
    ->live(debounce: 500)   // or ->live(onBlur: true), ->live(condition: false)
    ->afterStateUpdated(function (CronBuilder $component) {
        // While editing, the state is the 5-column array; use the helper to
        // get the composed cron string:
        $cron = $component->getComposedExpression();
    });

use InterwalNet\CronBuilder\Rules\ValidCronExpression;

$request->validate([
    'schedule' => ['

use InterwalNet\CronBuilder\Support\CronExpressionBuilder as Cron;

Cron::parse('*/15 4,12,20 * * 1-5');        // -> 5 column states
Cron::compose($columns);                     // -> '*/15 4,12,20 * * 1-5'
Cron::humanReadable('30 4 * * 1-5');         // -> 'At 04:30 on Monday-Friday'
Cron::isValid('30 4 * * 1-5');               // -> true
bash
php artisan vendor:publish --tag=cron-builder-config
php artisan vendor:publish --tag=cron-builder-views