kapersoft / knocker-for-laravel
This is my package knocker-for-laravel
Fund package maintenance!
kapersoft
Requires
- php: ^8.3
- laravel/framework: ^12.0
Requires (Dev)
- driftingly/rector-laravel: ^2.0
- ergebnis/composer-normalize: ^2.45
- larastan/larastan: ^3.2
- laravel/pint: ^1.14
- orchestra/testbench: ^10.1
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- pestphp/pest-plugin-type-coverage: ^3.4
- phpstan/extension-installer: ^1.3 || ^2.0
- phpstan/phpstan-deprecation-rules: ^1.1 || ^2.0
- phpstan/phpstan-phpunit: ^1.3 || ^2.0
- rector/rector: ^2.0
- spatie/laravel-ray: ^1.35
README
A Laravel package that seamlessly integrates your application with Knocker for Laravel Cloud - a reliable service that ensures your scheduled tasks continue running even when your Laravel application is in hibernation mode.
Learn more about Knocker for Laravel Cloud at https://knocker.laravel.cloud.
Requirements
- PHP 8.3 or higher
- Laravel 12.0 or higher
Installation
Install the package using Composer:
composer require kapersoft/knocker-for-laravel
Publish configuration file
If you like, you can publish the configuration file:
php artisan vendor:publish --tag="knocker-for-laravel-config"
This will create a configuration file with the following structure:
return [ 'endpoint' => env('KNOCKER_ENDPOINT', 'https://knocker.laravel.cloud/api/v1/schedulerTasks'), 'token' => env('KNOCKER_TOKEN', ''), ];
Configuration
After registering your application on Knocker for Laravel Cloud, add your authentication token to the .env
file:
KNOCKER_TOKEN=your-knocker-token-here
Usage
Registering Scheduled Tasks
To register your application's scheduled tasks with Knocker for Laravel Cloud, run the following command:
php artisan knocker:send-scheduler-tasks
This command performs the following actions:
- Scans your scheduled tasks. These are usually in
routes/console.php
orapp/Console/Kernel.php
- Extracts task configurations including:
- Cron expressions and timing
- Command names and descriptions
- Timezone settings
- Callback functions and closures
- Uploads the task information to Knocker for Laravel Cloud
Deployment Integration
For seamless integration, add the registration command to your deployment pipeline:
php artisan knocker:send-scheduler-tasks
This ensures your task configurations are automatically updated with each deployment, keeping Knocker for Laravel Cloud synchronized with your latest scheduled tasks.
Testing
Run the test suite:
composer test
Documentation
Please see the following files for additional information:
- CHANGELOG - Recent changes and version history
- CONTRIBUTING - Contribution guidelines
- LICENSE - MIT License details
Security
Please review our security policy for information on reporting security vulnerabilities.
Credits
- Jan Willem Kaper - Package Author
- All Contributors - Community Contributors
License
This package is open-sourced software licensed under the MIT License.