Simplify Installing and Updating your App With Laravel Executor
Published on by Paul Redmond
Laravel Executor is a package by Ash Allen that simplifies running code and commands when installing or updating your web application.
This package provides “executor” classes you can run from the artisan command line. A basic example is running the following command after pulling the latest version of a project from a remote repository:
<?php namespace App\Executor; use AshAllenDesign\LaravelExecutor\Classes\Executor; class AppUpdate extends Executor{ public function run(): Executor { return $this->simpleDesktopNotification('Starting Executor', 'Starting the AppUpdate Executor.') ->runExternal('composer install') ->runArtisan('migrate') ->runArtisan('cache:clear') ->completeNotification(); }}
The command would run composer installation, run artisan migrations, clear cache, and notify the user via desktop notifications.
To trigger the executor, you run artisan. Using the example above, it would look like:
php artisan executor:app-update
Here’s a visual of running an executor via the command line as seen in the project’s readme:
If you have a scenario where you want to manually run an executor, you can use the run()
method:
(new AppInstall())->run();
Learn More
You can learn more about this package, get full installation instructions, and view the source code on GitHub at ash-jc-allen/laravel-executor.