PHPackages                             a-bashtannik/fasti - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. a-bashtannik/fasti

ActiveLibrary[CLI &amp; Console](/categories/cli)

a-bashtannik/fasti
==================

Laravel task scheduler with calendar-based management.

v1.1.0(1y ago)133.6k—5%1[3 PRs](https://github.com/a-bashtannik/fasti/pulls)MITPHPPHP ^8.2CI passing

Since Oct 6Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/a-bashtannik/fasti)[ Packagist](https://packagist.org/packages/a-bashtannik/fasti)[ RSS](/packages/a-bashtannik-fasti/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (6)Used By (0)

[![](assets/cover.png)](assets/cover.png)

[![Build Status](https://github.com/a-bashtannik/fasti/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/a-bashtannik/fasti/actions)[![Total Downloads](https://camo.githubusercontent.com/90b734e142daa6d79feccbd41b024d8e22f3b9f1e4da505ab342d3d2df86bc83/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f612d6261736874616e6e696b2f66617374693f7374796c653d666c6174)](https://packagist.org/packages/a-bashtannik/fasti)[![Latest Stable Version](https://camo.githubusercontent.com/fef6b99d95c1f5a7a7350c39911c800ec647b1d2078ca465a9c2d722bf87bce9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f612d6261736874616e6e696b2f66617374693f7374796c653d666c6174)](https://packagist.org/packages/a-bashtannik/fasti)[![License](https://camo.githubusercontent.com/e229bbd557af1c14c868f9051e2b68cb2a37de75754de374a96e30cc531882ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f612d6261736874616e6e696b2f66617374693f7374796c653d666c6174)](https://packagist.org/packages/a-bashtannik/fasti)

Fasti is a Laravel package that enables developers to precisely schedule task execution in the future. With Fasti, you can defer the launch of any `Job` for any period, specifying the time and date to the minute. At the designated time, Fasti retrieves the required Job from the repository and either executes it synchronously or dispatches it to a queue.

Unlike Laravel's powerful recurring task scheduler, Fasti focuses on scheduling individual tasks for specific times. It's user-friendly, allowing you to easily create, list, or cancel tasks on demand.

```
$job = new SendGreetingEmail($user);

Fasti::schedule($job, '2024-12-31 23:59:59'); // Schedule a job for New Year's Eve 2024
```

Installation
------------

[](#installation)

Note

This package requires PHP 8.2+ and Laravel 11+

```
composer require a-bashtannik/fasti
```

Publish migration table:

```
php artisan vendor:publish --provider="Bashtannik\Fasti\Providers\FastiServiceProvider"
```

⚠️ Add the tick command to your `console.php` file:

```
use Bashtannik\Fasti\Console\Commands\FastiTickCommand;

Schedule::command(FastiTickCommand::class)->everyMinute();
```

Usage
-----

[](#usage)

### Schedule your jobs using well-known Laravel patterns and interfaces.

[](#schedule-your-jobs-using-well-known-laravel-patterns-and-interfaces)

Jobs are eligible for scheduling with Fasti if they implement a `handle()` method. At the scheduled time, Fasti executes your job synchronously within the cron job process thread, alongside any other cron jobs you've defined. To leverage Laravel's queuing system, simply implement the `ShouldQueue` interface on your job class. This allows Fasti to dispatch the job to Laravel's queue using the standard Bus facade behind the scenes.

```
use \Bashtannik\Fasti\Facades\Fasti;

class SendGreetingEmail implements ShouldQueue
{
    public function handle()
    {
        // Send the email
    }
}

$job = new SendGreetingEmail($user);

Fasti::schedule($job, '2024-12-31 23:59:59'); // Push job to the queue for New Year's Eve 2024
```

This job will be executed synchronously at the specified time:

```
use \Bashtannik\Fasti\Facades\Fasti;

class SendAlarmNotification
{
    public function handle()
    {
        // Send the notification
    }
}

$job = new SendAlarmNotification();

Fasti::schedule($job, '2025-01-01 08:00:00'); // Execute job synchronously on New Year's Day 2025
```

Fasti supports encrypted jobs if class implements `ShouldEncrypt` interface.

### Use tiny Eloquent model to store scheduled tasks

[](#use-tiny-eloquent-model-to-store-scheduled-tasks)

Fasti includes a lightweight Eloquent model that stores essential job information: ID, payload, and dates. While Fasti provides a service for convenient job management, you're not limited to it. In your controllers, you have the flexibility to interact directly with the Eloquent model using standard queries if you need more fine-grained control or custom operations.

```
// Use the facade

use \Bashtannik\Fasti\Facades\Fasti;

Fasti::all();
Fasti::schedule($job, $at);
Fasti::scheduled($at); // List all jobs scheduled for a specific time
Fasti::cancel($job);
Fasti::cancelled(); // List all cancelled jobs
Fasti::find($id);

// Or use the Eloquent model directly

use \Bashtannik\Fasti\Models\ScheduledJob;

ScheduledJob::where('scheduled_at', '=', '2024-12-31 23:59:59')->get();
```

### Testing

[](#testing)

Test your scheduled jobs with ease using Fasti's `Fasti::fake()` method and built-in assertions.

```
use \Bashtannik\Fasti\Facades\Fasti;

// If you are using custom model or repository, avoid using this method and test real storage instead.

Fasti::fake();

// Test if the expected job is scheduled

Fasti::assertScheduled($job);

// Or by job class name

Fasti::assertScheduled(SendGreetingEmail::class);

// Add custom assertion by using callback

Fasti::assertScheduled(function ($job) {
    return $job->type === 'send_greeting_email';
});

// Many other assertions are available

Fasti::assertNotScheduled($job);
Fasti::assertScheduledAt($job, '2024-12-31 23:59:59');
Fasti::assertNotScheduledAt($job, '2024-12-31 23:59:59');
Fasti::assertCancelled($job);
```

Fasti operates as a scheduling layer for your Laravel jobs, focusing solely on when to initiate them. It's important to note that Fasti doesn't manage job execution, queues, releases, attempts, or failures.

Instead, when the scheduled time arrives, Fasti simply hands off the job to Laravel's default `Bus`.

It means you are free to use well-known Bus assertion methods shipped with Laravel when the job is dispatched to the queue.

```
Bus::assertDispatched($job);
Bus::assertNotDispatched($job);

// etc.
```

### Using custom models or storage to manage scheduled jobs

[](#using-custom-models-or-storage-to-manage-scheduled-jobs)

For simple applications, Fasti's built-in Eloquent model is sufficient. However, if you need to store scheduled jobs in a custom database table or use a different storage mechanism, Fasti provides a way to do so.

Define your own model implementing the `Bashtannik\Fasti\Contracts\SchedulableJob` interface.

It's important to note that while your model is required to implement this interface, it doesn't overload it with new properties or methods. This approach allows Eloquent to operate normally. You are simply required to provide a standard set of fields in the model or data transfer object to ensure Fasti works smoothly and your IDE's type checking is happy.

```
use Illuminate\Database\Eloquent\Model;
use Bashtannik\Fasti\Contracts\SchedulableJob;

class MyOwnModel extends Model implements SchedulableJob
{
    // Your code
}
```

Create your own repository that implements the `FastiScheduledJobsRepository` interface and bind it in your app service provider `register()` method.

```
use Bashtannik\Fasti\Repositories\FastiRepository;
use App\Repositories\MyOwnRepository;

$this->app->bind(
    FastiScheduledJobsRepository::class,
    MyOwnRepository::class
);

// Or if you just need to switch the model

$this->app->bind(
    FastiScheduledJobsRepository::class,
    function () {
        $repository = new FastiEloquentRepository;
        $respository::$model = MyOwnModel::class;

        return $repository;
    }
);
```

### Hint: store human-friendly job type name

[](#hint-store-human-friendly-job-type-name)

When using `FastiEloquentRepository` repository, by default it stores class name in the `type` field. However, you can define your own set of human-friendly names in your AppServiceProvider like you do with morph-many relationships.

```
use Bashtannik\Fasti\Repositories\FastiEloquentRepository;

FastiEloquentRepository::enforceTypeMapping([
    'fake_job' => FakeJob::class,
]);
```

This field doesn't affect the job execution but can be useful for debugging or logging purposes.

### Hint: monitor your scheduled jobs using artisan `fasti:list` command

[](#hint-monitor-your-scheduled-jobs-using-artisan-fastilist-command)

[![](https://private-user-images.githubusercontent.com/2712350/373951860-c8618517-d80a-4f36-b25b-b2d9f226f4d5.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ3MzQ4MzEsIm5iZiI6MTc3NDczNDUzMSwicGF0aCI6Ii8yNzEyMzUwLzM3Mzk1MTg2MC1jODYxODUxNy1kODBhLTRmMzYtYjI1Yi1iMmQ5ZjIyNmY0ZDUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hB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yXMVhw38AEql6_TlkFnwb7f3g9J8UM)### Simulate time in your manual tests and check if the job is executed

[](#simulate-time-in-your-manual-tests-and-check-if-the-job-is-executed)

```
php artisan fasti:tick --now="2024-12-31 23:59:59"
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance57

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

589d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/317361?v=4)[Bashtannik](/maintainers/bashtannik)[@bashtannik](https://github.com/bashtannik)

---

Top Contributors

[![a-bashtannik](https://avatars.githubusercontent.com/u/2712350?v=4)](https://github.com/a-bashtannik "a-bashtannik (13 commits)")

---

Tags

calendarlaravellaravel-packageschedulertask-managertask-schedulertasksschedulerlaravelpackageeventslaravel-packagecroncalendarschedulingTaskstask managementJob Schedulingcommand schedulingdate-based taskstime-based taskstask automationtask organizationperiodic taskstimed eventsschedule management

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/a-bashtannik-fasti/health.svg)

```
[![Health](https://phpackages.com/badges/a-bashtannik-fasti/health.svg)](https://phpackages.com/packages/a-bashtannik-fasti)
```

###  Alternatives

[jmose/command-scheduler-bundle

This Symfony bundle will allow you to schedule all your commands just like UNIX crontab

3361.4M1](/packages/jmose-command-scheduler-bundle)[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[sheaf/cli

A CLI tool for Sheaf UI

269.3k1](/packages/sheaf-cli)[dukecity/command-scheduler-bundle

This Symfony bundle will allow you to schedule all your commands just like UNIX crontab

25350.9k5](/packages/dukecity-command-scheduler-bundle)[matviib/scheduler

Service for scheduling and managing cron tasks in laravel application

213.3k](/packages/matviib-scheduler)[flyingfoxx/commandcenter

Commands and domain events for any framework. Includes a Laravel implementation.

152.2k](/packages/flyingfoxx-commandcenter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
