win-local-inc/remote-cron

A package for remote cron.
4,568
Install
composer require win-local-inc/remote-cron
Latest Version:1.1.0
PHP:^8.0
License:MIT
Last Updated:Apr 19, 2023
Links: GitHub  ·  Packagist
Maintainer: rawaby88

Remote call Package

Installation

  • update array to your needs in config/remotecron.php with
[
    'middleware' => [
        'throttle:remotecron',
        WinLocal\RemoteCron\Middleware\TokenAuth::class,
    ],
    'path' => env('WINLOCAL_CRON_PATH', 'remote/cron'),
    'queue_connection' => env('WINLOCAL_CRON_QUEUE_CONNECTION', 'redis'),
    'token' => env('WINLOCAL_CRON_TOKEN'),
];
  • add envs :
WINLOCAL_CRON_PATH=
WINLOCAL_CRON_TOKEN=
WINLOCAL_CRON_QUEUE_CONNECTION=
  • each service needs to run supervisor

php artisan queue:work redis --max-time=3600 --max-jobs=100 --tries=3 --timeout=3550

  • new cron jobs needs to be add in super admin service database in tables : cron_services, cron_jobs

cron_services
name: Advert
url: https://sericename.stage.com/remote/cron 
token: ***token***

cron_jobs
name: Report Upload
command: facebook:upload
parameters:
schedule: */10 * * * *

  • to run tests on package

vendor/bin/testbench package:test --configuration=tests/phpunit.xml

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

634,760,849 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

493,838,477 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

408,553,772 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

387,976,821 4,658