msazzuhair / laravel-artisan-destroy
This is my package laravel-artisan-destroy
Fund package maintenance!
Muhammad Azzuhair
Requires
- php: ^8.1
- illuminate/contracts: ^11.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^2.0.1
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.1
- orchestra/testbench: 9.*
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.5
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
README
⚠️⚠️ 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
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
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
php artisan destroy:model <Model Name>
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] [--] <name> 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
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.