PHPackages                             dadehpardaz/laravel-executor - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. dadehpardaz/laravel-executor

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

dadehpardaz/laravel-executor
============================

Configurable code that can be ran when installing or updating your web app.

v2.2.0(5y ago)0209MITPHPPHP ^7.2|^8.0

Since Jun 8Pushed 4y agoCompare

[ Source](https://github.com/mortezababanezhad/laravel-executor)[ Packagist](https://packagist.org/packages/dadehpardaz/laravel-executor)[ Docs](https://github.com/ash-jc-allen/laravel-executor)[ GitHub Sponsors](https://github.com/ash-jc-allen)[ RSS](/packages/dadehpardaz-laravel-executor/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (7)Versions (13)Used By (0)

[![](https://camo.githubusercontent.com/d17db5f78636d393157a3e54c92b83d2b292c5e80c3c91ab0582aac2f3dd4cbb/68747470733a2f2f617368616c6c656e64657369676e2e636f2e756b2f696d616765732f637573746f6d2f6c61726176656c2d6578656375746f722d6c6f676f2e706e67)](https://camo.githubusercontent.com/d17db5f78636d393157a3e54c92b83d2b292c5e80c3c91ab0582aac2f3dd4cbb/68747470733a2f2f617368616c6c656e64657369676e2e636f2e756b2f696d616765732f637573746f6d2f6c61726176656c2d6578656375746f722d6c6f676f2e706e67)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e1c9c017e4070a6b7a3aeb574fd6190a0590c9057241bcd41b6d95163e6e6ced/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617368616c6c656e64657369676e2f6c61726176656c2d6578656375746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ashallendesign/laravel-executor)[![Build Status](https://camo.githubusercontent.com/067b50e326ff35566750241d8d795c86fef5b31973a97e9cfcef522599d14ca2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6173682d6a632d616c6c656e2f6c61726176656c2d6578656375746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/ash-jc-allen/laravel-executor)[![Total Downloads](https://camo.githubusercontent.com/50f9674b624db3d5b5fae31f3b7fcae6ac302f8717bc6e3ec731594034b84713/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617368616c6c656e64657369676e2f6c61726176656c2d6578656375746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ashallendesign/laravel-executor)[![PHP from Packagist](https://camo.githubusercontent.com/cde02f724f03c2c1b2610da4a1da60d012dc5ca89d6f8ff0705dfad428afaad9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f617368616c6c656e64657369676e2f6c61726176656c2d6578656375746f723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ashallendesign/laravel-executor)[![GitHub license](https://camo.githubusercontent.com/28f41d02b0296eb9de70e3a7bffc537454702922d835a250aebc66bf5b8273ea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6173682d6a632d616c6c656e2f6c61726176656c2d6578656375746f723f7374796c653d666c61742d737175617265)](https://github.com/ash-jc-allen/laravel-executor/blob/master/LICENSE)

Table of Contents
-----------------

[](#table-of-contents)

- [Overview](#overview)
- [Installation](#installation)
    - [Requirements](#requirements)
    - [Install the Package](#install-the-package)
- [Usage](#usage)
    - [Creating an Executor](#creating-an-executor)
        - [Creating a New Executor](#creating-a-new-executor)
        - [Creating an Executor with a Command](#creating-an-executor-with-a-command)
    - [Updating an Executor](#updating-an-executor)
        - [Adding an Artisan Command](#adding-an-artisan-command)
        - [Adding a Command](#adding-a-command)
        - [Adding a Closure](#adding-a-closure)
        - [Adding Desktop Notifications](#adding-desktop-notifications)
        - [Pinging a URL](#pinging-a-url)
    - [Running the Executors](#running-the-executors)
        - [Running via the Console](#running-via-the-console)
        - [Running Manually](#running-manually)
- [Examples](#examples)
- [Security](#security)
- [Contribution](#contribution)
- [Credits](#credits)
- [Changelog](#changelog)
- [License](#license)

Overview
--------

[](#overview)

A Laravel package that simplifies running code and commands when installing or updating your web app.

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

[](#installation)

### Requirements

[](#requirements)

The package has been developed and tested to work with the following minimum requirements:

- PHP 7.2
- Laravel 6

### Install the Package

[](#install-the-package)

You can install the package via Composer:

```
composer require ashallendesign/laravel-executor
```

Usage
-----

[](#usage)

### Creating an Executor

[](#creating-an-executor)

#### Creating a New Executor

[](#creating-a-new-executor)

To create a new Executor, you can use the following command:

```
php artisan make:executor YourExecutorNameHere
```

The above command would create an Executor named `YourExecutorNameHere` that can be found in the `app/Executor`folder.

#### Creating an Executor with a Command

[](#creating-an-executor-with-a-command)

Generally, Executors are expected to be run within a console. So, when creating a new Executor, if you intend for it to be run in the console, you can use the following command:

```
php artisan make:executor YourExecutorNameHere -c
```

The command above will create the exact same boilerplate for your new Executor as the command in [Creating a New Executor](#creating-a-new-executor). However, it will create a new command in your `app/Commands` folder named `RunYourExecutorNameHereExecutor`. This means that you won't need a new command manually to run your executor.

Learn more in [Running via the Console](#running-via-the-console) to find out how to run the Executor inside the commands.

### Updating an Executor

[](#updating-an-executor)

#### Adding an Artisan Command

[](#adding-an-artisan-command)

To run an Artisan command via your Executor class, you can add the `runArtisan()` method to your Executor's `run()`method. For example, the code below shows how you could set the Executor to run the built-in Laravel `php artisan cache:clear`command:

```
