PHPackages                             usermp/artisan-api - 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. usermp/artisan-api

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

usermp/artisan-api
==================

artisan-api is a Laravel package that allows you to execute Artisan commands via an API route

v1.0.3(1y ago)438MITPHPPHP ^8.2

Since May 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/usermp/artisan-api)[ Packagist](https://packagist.org/packages/usermp/artisan-api)[ RSS](/packages/usermp-artisan-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

artisan-api
-----------

[](#artisan-api)

[![usermp-artisan-api](https://camo.githubusercontent.com/fa1597d4f8e13a7469ebc795b811f1431f1f03758f941f565e16e5b2d4170acc/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532304172746973616e2532304170692e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d757365726d702532466172746973616e2d617069267061747465726e3d62616e6b4e6f7465267374796c653d7374796c655f31266465736372697074696f6e3d412b7061636b6167652b746861742b616c6c6f77732b796f752b746f2b657865637574652b4172746973616e2b636f6d6d616e64732b7669612b616e2b4150492b726f757465266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/fa1597d4f8e13a7469ebc795b811f1431f1f03758f941f565e16e5b2d4170acc/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532304172746973616e2532304170692e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d757365726d702532466172746973616e2d617069267061747465726e3d62616e6b4e6f7465267374796c653d7374796c655f31266465736372697074696f6e3d412b7061636b6167652b746861742b616c6c6f77732b796f752b746f2b657865637574652b4172746973616e2b636f6d6d616e64732b7669612b616e2b4150492b726f757465266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

artisan-api is a Laravel package that allows you to execute Artisan commands via an API route. This package simplifies the process of managing your Laravel application's Artisan commands by providing a straightforward and easy-to-use API interface.

### Installation

[](#installation)

To install the artisan-api package, you can use Composer. Run the following command in your terminal:

```
composer require usermp/artisan-api
```

After installing the package, you need to register the ArtisanServiceProvider in your Laravel application. To do this, add the service provider to the providers array in your `bootstrap/providers.php` file:

```
return [
    ...
     Usermp\ArtisanApi\ArtisanServiceProvider::class,
],
```

Next, publish the configuration file to customize the package's settings. Run the following command:

```
php artisan vendor:publish --provider="Usermp\ArtisanApi\ArtisanServiceProvider" --tag="artisan-api-config"
```

This will create a configuration file at `config/artisanapi.php`.

### Configuration

[](#configuration)

The configuration file allows you to customize the behavior of the artisan-api package. Below is the default configuration:

```
return [
    'with_key' => env('ARTISAN_WITH_KEY', false),
    'api_key'  => env('ARTISAN_API_KEY', 'YOUR KEY'),
    'allowed_commands' => [
        // General commands
        'list',
        'help',

        // Make commands
        'make:controller',
        'make:model',
        'make:migration',
        'make:seeder',
        'make:factory',
        'make:middleware',
        'make:request',
        'make:resource',
        'make:command',
        'make:event',
        'make:listener',
        'make:policy',
        'make:provider',
        'make:test',
        'make:job',
        'make:rule',
        'make:mail',
        'make:notification',

        // Migrations
        'migrate',
        'migrate:rollback',
        'migrate:refresh',
        'migrate:reset',
        'migrate:status',

        // Seeder
        'db:seed',
        'db:wipe',

        // Cache
        'cache:clear',
        'cache:forget',
        'config:clear',
        'config:cache',
        'route:cache',
        'route:clear',
        'view:cache',
        'view:clear',

        // Queue
        'queue:work',
        'queue:listen',
        'queue:restart',
        'queue:table',
        'queue:flush',

        // Maintenance
        'down',
        'up',

        // Others
        'optimize',
        'serve',
        'schedule:run',
        'schedule:work',

        // Add other commands as needed
    ],
];
```

- `with_key`: Determines if an API key is required to execute commands. Default is `false`.
- `api_key`: The API key used for authentication when `with_key` is set to `true`
- `allowed_commands`: An array of allowed Artisan commands that can be executed via the API.

### Usage

[](#usage)

Running Artisan Commands via API You can run any Artisan command using the `api/artisan` route. The request should be a POST request and include the command and its arguments in the request body.

Example Request

```
POST /api/artisan
Content-Type: application/json
{
  "command": "migrate:fresh --seed",
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance41

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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 ~47 days

Total

4

Last Release

579d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.0.3PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/48add354597189247b456142f8384caf8b7dde8d30e48eab47b6a1484ebceecc?d=identicon)[usermp](/maintainers/usermp)

---

Top Contributors

[![usermp](https://avatars.githubusercontent.com/u/39251365?v=4)](https://github.com/usermp "usermp (35 commits)")

### Embed Badge

![Health badge](/badges/usermp-artisan-api/health.svg)

```
[![Health](https://phpackages.com/badges/usermp-artisan-api/health.svg)](https://phpackages.com/packages/usermp-artisan-api)
```

###  Alternatives

[acdphp/laravel-schedule-police

Stop, start or execute scheduled commands from a simple dashboard without redeploying, while maintaining the visibility, control, and reviewability of the configurations in your codebase.

5116.9k](/packages/acdphp-laravel-schedule-police)[jakyeru/laravel-shell

Laravel-Shell adds a terminal interface to your web application, allowing you to run shell commands directly from your browser.

166.1k](/packages/jakyeru-laravel-shell)

PHPackages © 2026

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