PHPackages                             masgeek/artisan-toolkit - 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. masgeek/artisan-toolkit

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

masgeek/artisan-toolkit
=======================

A collection of custom and override Artisan commands for Laravel. Enable only what you need via a published config.

1.2.0(1mo ago)0135MITPHP ^8.2

Since May 7Compare

[ Source](https://github.com/masgeek/artisan-toolkit)[ Packagist](https://packagist.org/packages/masgeek/artisan-toolkit)[ RSS](/packages/masgeek-artisan-toolkit/feed)WikiDiscussions Synced 3w ago

READMEChangelog (4)Dependencies (3)Versions (9)Used By (0)

masgeek/artisan-toolkit
=======================

[](#masgeekartisan-toolkit)

A collection of custom and override Artisan commands for Laravel. Enable only what you need via a single published config file.

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

[](#installation)

```
composer require masgeek/artisan-toolkit
```

Publish the config:

```
php artisan vendor:publish --tag=artisan-toolkit-config
```

Configuration
-------------

[](#configuration)

The published `config/artisan-toolkit.php` controls which commands are active and configures package-wide settings:

```
return [
    'overrides' => [
        'schema:dump' => \Masgeek\ArtisanToolkit\Commands\SchemaDumpCommand::class,
    ],

    'model_scan_paths' => [
        'app/Models',
        'app/Models/Base',
    ],

    'commands' => [
        'make:enum'            => \Masgeek\ArtisanToolkit\Commands\MakeEnumCommand::class,
        'make:repo'            => \Masgeek\ArtisanToolkit\Commands\MakeRepositoryCommand::class,
        'make:api-scaffold'    => \Masgeek\ArtisanToolkit\Commands\MakeApiScaffoldCommand::class,
        'make:resource-full'   => \Masgeek\ArtisanToolkit\Commands\MakeFullResourceCommand::class,
        'model:relations'      => \Masgeek\ArtisanToolkit\Commands\ListModelRelationsCommand::class,
        'model:prune-orphaned' => \Masgeek\ArtisanToolkit\Commands\PruneOrphanedModelsCommand::class,
    ],
];
```

Setting a command value to `false` (or removing the entry) disables it and leaves Laravel's built-in in place.

### `model_scan_paths`

[](#model_scan_paths)

Directories (relative to your app's base path) that `model:prune-orphaned` scans when no `--path` option is given on the CLI. Adjust this list to match your project's model layout:

```
'model_scan_paths' => [
    'app/Models',
    'app/Models/Base',
    'app/Domain/Shared/Models', // example custom path
],
```

Available overrides
-------------------

[](#available-overrides)

### `schema:dump`

[](#schemadump)

The built-in `php artisan schema:dump --prune` deletes **every** file under `database/migrations/`. This override changes `--prune` to only delete migration files whose name exists in the `migrations` table — **pending (unrun) migrations are kept on disk**.

```
# Dump schema and delete only already-run migration files
php artisan schema:dump --prune

# Dump without pruning (identical to built-in behaviour)
php artisan schema:dump
```

Output when `--prune` is used:

```
2024_01_01_000000_create_users_table.php .............. deleted
2026_05_07_085600_rename_playground_role.php .......... kept (pending)
Database schema dumped and pruned (1 deleted, 1 pending kept) successfully.

```

Available commands
------------------

[](#available-commands)

### `make:enum`

[](#makeenum)

Laravel has no built-in enum generator. This command creates a PHP enum in `app/Enums/`.

```
# Pure (unbacked) enum
php artisan make:enum Status

# Backed string enum with cases pre-filled
php artisan make:enum UserRole --backed=string --cases=Admin,Partner,User

# Backed int enum in a sub-namespace
php artisan make:enum Billing/InvoiceStatus --backed=int --cases=Draft,Pending,Paid,Void

# Overwrite an existing file
php artisan make:enum UserRole --force
```

Example output for `php artisan make:enum UserRole --backed=string --cases=Admin,Partner,User`:

```
