PHP
import { Aside } from ‘@astrojs/starlight/components’;
Quickstart
Historical package install steps below. Prefer check-in recipes for new setups.
Get from zero to your first data in under 3 minutes.
1. Prerequisites
- PHP 8.1+
- A Crontinel account (sign up free)
- An app created in the dashboard
- Your API key (
crn_live_...) from app settings
2. Install
composer require crontinel/php3. Configure
Create a quickstart.php file:
<?phprequire 'vendor/autoload.php';
$crontinel = new \Crontinel\Client(getenv('CRONTINEL_API_KEY'));
$crontinel->scheduleRun([ 'command' => 'hello-from-php', 'duration_ms' => 100, 'exit_code' => 0,]);
echo "Data sent to Crontinel!\n";Set your API key and run it:
export CRONTINEL_API_KEY=crn_live_xxxxxxxxxxxxphp quickstart.php4. Dashboard verification
- Go to app.crontinel.com → Apps → your app
- Check the Cron section — you should see the
hello-from-phpjob with exit code0and100msduration - Your first data is on the dashboard!
Requirements
- PHP 8.1+
Install
composer require crontinel/phpQuick Start
<?phprequire 'vendor/autoload.php';
$crontinel = new \Crontinel\Client(getenv('CRONTINEL_API_KEY'));
// Report a cron job run$crontinel->scheduleRun([ 'command' => 'reports:generate', 'duration_ms' => 2340, 'exit_code' => 0,]);
// Report queue worker activity$crontinel->queueProcessed([ 'queue' => 'emails', 'processed' => 12, 'failed' => 0, 'duration_ms' => 8901,]);monitorSchedule
Wrap any callable and auto-report outcome:
$result = $crontinel->monitorSchedule('reports:generate', function () { return generateDailyReports();});// ['result' => ..., 'duration_ms' => 1840, 'exit_code' => 0]Symfony Messenger integration
$crontinel->wrap(function (array $payload) use ($handler) { $start = microtime(true) * 1000; try { $result = $handler($payload); $crontinel->queueProcessed([ 'queue' => 'default', 'processed' => 1, 'failed' => 0, 'duration_ms' => (int)(microtime(true) * 1000 - $start), ]); return $result; } catch (\Throwable $e) { $crontinel->queueProcessed([ 'queue' => 'default', 'processed' => 0, 'failed' => 1, 'duration_ms' => (int)(microtime(true) * 1000 - $start), ]); throw $e; }});Environment variables
| Variable | Default | Description |
|---|---|---|
CRONTINEL_API_KEY | — | Your Crontinel API key (required) |
CRONTINEL_API_URL | https://app.crontinel.com | SaaS or self-hosted endpoint |
Laravel
For Laravel, use crontinel/laravel instead — it auto-instruments Horizon, the scheduler, and queue workers with zero code changes.