Download the PHP package ramir1/laravel-planner without Composer

On this page you can find all versions of the php package ramir1/laravel-planner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-planner

Laravel Planner

Database-backed planner of one-off deferred artisan commands for Laravel.

Laravel has queues (including delayed jobs) and a scheduler for recurring commands. A delayed job, however, lives inside the queue backend: you cannot list it, cancel it, or survive a queue flush. Planner stores every planned run in a table: schedule a command for a given moment, group runs, cancel them and see what happened to each one.

Русская версия

Installation

planner:run is registered in the Laravel scheduler automatically (every minute, without overlapping), so make sure the scheduler (schedule:run / schedule:work) and a queue worker are running.

By default (PLANNER_SCHEDULE=inline) the planner runs inside the already booted schedule:run process: no extra PHP process is started every minute, so an empty planner costs two cheap queries. Set PLANNER_SCHEDULE=process to run it as a separate php artisan planner:run process, or false to register nothing and run planner:run yourself.

In inline mode use an asynchronous queue: with QUEUE_CONNECTION=sync the planned commands are executed right inside schedule:run and delay the other scheduled events.

Publish the config if you need to change defaults:

Writing a command

Any artisan command can be planned; the command knows nothing about the planner. Pass models by id. Business decisions ("not relevant any more", "cancel the remaining runs") belong to the command:

The planner only runs the command and records the result: exit code 0 — done; any other code or an exception — retried after backoff seconds, failed after max_attempts. The command output is stored in the task message (up to 1000 characters).

Scheduling

From the console — time is anything Carbon::parse() understands, in the application timezone:

From code:

schedule() does not check that the command exists (that would load every command of the application on each call); an unknown command fails when it runs. planner:at does check it.

source (optional morph, source: $orderLine) records where a run came from, e.g. a paid order line.

Statuses and execution

pending → running → done | failed; canceled — cancelled before it ran (cancelGroup()).

Every minute planner:run takes due pending runs (oldest run_at first, up to batch), atomically marks each one running and dispatches RunPlannedTaskJob to the queue. The worker runs the command in-process via Artisan::call() — no new PHP process, so the overhead per run is negligible compared to the command itself (about 0.1 ms for an empty command). Runs are dispatched in run_at order but executed in parallel by the workers; a group is for cancelling together, not for ordering.

A run stuck in running longer than stuck_after minutes (dead worker) is returned to pending; a stale job of such a run is ignored, so it is not executed twice.

Missed runs

A run is due when it is pending and run_at <= now(); this is checked once a minute, so a run starts within about a minute after run_at (plus the queue wait). Runs live in the database, so nothing is lost while the server is down: after it comes back, the first planner:run dispatches every missed run (oldest first, up to batch per minute).

There is no "too late" limit — a run late by a week still executes. If a late run makes no sense, the command checks it itself:

A run interrupted by a shutdown stays running and is returned to pending after stuck_after minutes, then executed again — write commands so that a repeated run is safe.

run_at is stored in the application timezone (app.timezone); changing it shifts all planned runs.

Configuration

Key Default Description
table planned_tasks table name
run_migrations true load package migrations (disable if published via planner-migrations)
schedule inline (PLANNER_SCHEDULE) inline — inside schedule:run, process — separate process, false — not registered
connection, queue null queue for RunPlannedTaskJob
batch 500 due runs dispatched per planner:run
max_attempts, backoff 3, 300 retries on a non-zero exit code or an exception
stuck_after 60 minutes before a running task is released

Testing

License

MIT


All versions of laravel-planner with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/bus Version ^11.0|^12.0|^13.0
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/queue Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ramir1/laravel-planner contains the following files

Loading the files please wait ...