kima92/expector-patronum

This is my package expector-patronum

0.9.10 2024-03-12 10:11 UTC

This package is auto-updated.

Last update: 2024-04-12 10:26:11 UTC


README

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

ExpectorPatronum is a Laravel-based system designed to manage and monitor task expectations and actual performances. It includes features like task scheduling, real-time monitoring, and integration with calendar interfaces for effective visualization and management.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Requirements

  • PHP >= 8.2
  • Laravel >= 9.0
  • MySQL or a compatible database system

Installation

You can install the package via composer:

composer require kima92/expector-patronum

You can publish and run the migrations with:

php artisan vendor:publish --tag="expector-patronum-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="expector-patronum-config"

Optionally, you can publish the views using

php artisan vendor:publish --tag="expector-patronum-views"

Usage

Configure a new Plan (1 time) via /expector-patronum path, or by code:

$group = Group::query()->create(['name' => 'bla', 'color' => 'green']);
$expector = new Expector();

$plan = $expector->generatePlan('transmit 231', '0 20 * * *', $group, [['type' => StartedInTimeCheck::RULE_NAME]]);

Create next expectation days (this process is already scheduled every day to 20:00)

$expector->generateNextExpectations(CarbonImmutable::create(2024), CarbonImmutable::create(2024, day: 2));

Run the task

ExpectorPatronum::runTask('my Task', fn() => sleep(5));

General configurations via AppServiceProvider::register

Authorization With:

ExpectorPatronum::authWith(fn (Request $request) => !$this->app->environment('production') && $request->user())

Custom task identifier:

ExpectorPatronum::setExpectationUuidResolver(fn () => Str::uuid()->toString())

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions to ExpectorPatronum are welcome. Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch for each feature or improvement.
  3. Submit a pull request with a clear description of the changes.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.