Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Scheduled Command Bundle Laravel Package

carles/scheduled-command-bundle

View on GitHub
Deep Wiki
Context7

Command Scheduler Symfony bundle

This bundle lets you schedule commands using the unix at command.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

composer require carles/scheduled-command-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Usage

To schedule a command simply configure a ScheduledCommand and persist it:

use CommandSchedulerBundle\Entity\ScheduledCommand;

$scheduledCommand = new ScheduledCommand();

$scheduledCommand->setCommand("echo 'Happy New Year'");
$scheduledCommand->setDatetime(new \DateTime('01-01-2020 00:00:00'));

$this->getDoctrine()->getManager()->persist($scheduledCommand);
$this->getDoctrine()->getManager()->flush();

The bundle uses doctrine events to create an at job with the configured command. The command will be stored in a file under the configured directory.
The default directory is /tmp, but feel free to change it in the configuration:

scheduled_command:
    temp_command_files_dir: /my/directory

At the moment this bundle is only working in unix environments where the at command is installed, but it would be nice to add Windows compatibility in the future.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
babenkoivan/elastic-client
innmind/static-analysis
innmind/coding-standard
datacore/hub-sdk
alengo/sulu-http-cache-bundle
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme
agtp/agtp-php
agtp/mod-php
centraldesktop/protobuf-php