PHPackages                             msazzuhair/laravel-artisan-destroy - 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. msazzuhair/laravel-artisan-destroy

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

msazzuhair/laravel-artisan-destroy
==================================

This is my package laravel-artisan-destroy

v0.2.0(2y ago)025[4 PRs](https://github.com/msazzuhair/laravel-artisan-destroy/pulls)MITPHPPHP ^8.1CI passing

Since Mar 5Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/msazzuhair/laravel-artisan-destroy)[ Packagist](https://packagist.org/packages/msazzuhair/laravel-artisan-destroy)[ Docs](https://github.com/msazzuhair/laravel-artisan-destroy)[ GitHub Sponsors]()[ RSS](/packages/msazzuhair-laravel-artisan-destroy/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (13)Versions (8)Used By (0)

Artisan Destroy Commands for Laravel
====================================

[](#artisan-destroy-commands-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2cd13bc5b9d4fbf0149f275f4945b8b2dc980756f7aed91616ec2531a07f0ccc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d73617a7a75686169722f6c61726176656c2d6172746973616e2d64657374726f792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/msazzuhair/laravel-artisan-destroy)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6d7217c77a558305a7e8954c461428db98d45d4853612f7f3e2a744e6c1ee38b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d73617a7a75686169722f6c61726176656c2d6172746973616e2d64657374726f792f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/msazzuhair/laravel-artisan-destroy/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/416851205a0fc749fde8c1109b3fa66e4a92dfc820708c3aee7663281c7000a0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d73617a7a75686169722f6c61726176656c2d6172746973616e2d64657374726f792f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/msazzuhair/laravel-artisan-destroy/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/fa8fefef1ecc925fba382a248db5553a1d84c4d6e4e400477d9924ad0d1a2644/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d73617a7a75686169722f6c61726176656c2d6172746973616e2d64657374726f792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/msazzuhair/laravel-artisan-destroy)

⚠️⚠️ Do not install this package on your production environment. ⚠️⚠️

A (maybe?) missing destroy command for anyone who has second thoughts. This will delete artisan-generated files from your project.

Let's say, you have generated some files using the `artisan make` command. Then you think of a better name, or the generated files don't have a proper name based on the Laravel naming convention. This simple package will help you clean up those messes.

Just replace your `artisan make:...` command with `artisan destroy:...` and you're good to go. These commands will also warn you if the file you are trying to delete is untracked or has uncommitted changes.

I have used some of these commands on my projects, so ️they should work.

Development Progress
--------------------

[](#development-progress)

ClassCommandDestroy CommandTestCast`destroy:cast`✅✅Channel`destroy:channel`✅✅Component`destroy:component`✅Controller`destroy:controller`✅Console`destroy:console`✅Event`destroy:event`✅Exception`destroy:exception`✅Factory`destroy:factory`✅Job`destroy:job`✅Listener`destroy:listener`✅Mail`destroy:mail`✅Middleware`destroy:middleware`✅Migration`destroy:migration`✅Model`destroy:model`✅Notification`destroy:notification`✅Observer`destroy:observer`✅Policy`destroy:policy`✅Provider`destroy:provider`✅Request`destroy:request`✅Resource`destroy:resource`✅Rule`destroy:rule`✅Scope`destroy:scope`✅Seeder`destroy:seeder`✅Test`destroy:test`✅View`destroy:view`✅Optional Requirements
---------------------

[](#optional-requirements)

- Git. This package will check if the file to be deleted is tracked and clean. If git is not installed, you'll need to use the `--force` option or disable git checking through the config file.

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

[](#installation)

You can install the package as a dev dependency via composer:

```
composer require --dev msazzuhair/laravel-artisan-destroy
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-artisan-destroy-config"
```

Usage
-----

[](#usage)

```
php artisan destroy:model
```

You can use artisan help to see all available options for each command. For example:

```
php artisan help destroy:model
```

```
Description:
  Delete an Eloquent model class

Usage:
  destroy:model [options] [--]

Arguments:
  name                  The name of the model

Options:
  -a, --all             Delete a migration, seeder, factory, policy, resource controller, and form request classes for the model
  -c, --controller      Delete a controller for the model
  -f, --factory         Delete a factory for the model
      --force           Delete the class without prompting for confirmation
  -m, --migration       Delete a migration file for the model
      --policy          Delete a policy for the model
  -s, --seed            Delete a seeder for the model
  -R, --requests        Delete new form request classes and use them in the resource controller
  -t, --test            Delete any accompanying PHPUnit test for the model and every related classes that is going to also be deleted
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --env[=ENV]       The environment the command should run under
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Muhammad Azzuhair](https://github.com/msazzuhair)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance56

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~7 days

Total

2

Last Release

844d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7079c0afe5d305fbc5bf1cc1d81998e6317aa2155f13a7120caaeeed1e0e0250?d=identicon)[msazzuhair](/maintainers/msazzuhair)

---

Top Contributors

[![msazzuhair](https://avatars.githubusercontent.com/u/15320135?v=4)](https://github.com/msazzuhair "msazzuhair (36 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")

---

Tags

laravelMuhammad Azzuhairlaravel-artisan-destroy

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/msazzuhair-laravel-artisan-destroy/health.svg)

```
[![Health](https://phpackages.com/badges/msazzuhair-laravel-artisan-destroy/health.svg)](https://phpackages.com/packages/msazzuhair-laravel-artisan-destroy)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M101](/packages/dedoc-scramble)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.9k3](/packages/defstudio-telegraph)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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