Skip to content

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.

License

Notifications You must be signed in to change notification settings

kapersoft/knocker-for-laravel

Repository files navigation

Knocker for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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:

  1. Scans your scheduled tasks. These are usually in routes/console.php or app/Console/Kernel.php
  2. Extracts task configurations including:
    • Cron expressions and timing
    • Command names and descriptions
    • Timezone settings
    • Callback functions and closures
  3. 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:

Security

Please review our security policy for information on reporting security vulnerabilities.

Credits

License

This package is open-sourced software licensed under the MIT License.

About

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.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages