pragnesh / laravel-package-helper
提供一系列命令以创建laravel包,类似于artisan命令。
v1.0.2
2023-02-16 13:43 UTC
Requires
- php: >=8.0
- symfony/console: ^6.2
- symfony/filesystem: ^6.2
Requires (Dev)
- phpunit/phpunit: ^10
README
提供一系列命令以创建laravel包,类似于artisan命令。
安装
composer require pragnesh/laravel-package-helper --dev
可用命令
列出所有命令
./vendor/bin/larapack
安装配置
./vendor/bin/larapack config:install
描述:将创建config/larapack.php文件,并更新package-namespace变量,以符合您的包命名空间
提供者
./vendor/bin/larapack make:provider NAME
Arguments:
name The name of the provider class
模型
./vendor/bin/larapack make:model NAME
Arguments:
name The name of the model class
Options:
-a, --all Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model
-c, --controller Create a new controller for the model
-f, --factory Create a new factory for the model
-m, --migration Create a new migration file for the model
--morph-pivot Indicates if the generated model should be a custom polymorphic intermediate table model
--policy Create a new policy for the model
-s, --seed Create a new seeder for the model
-p, --pivot Indicates if the generated model should be a custom intermediate table model
-r, --resource Indicates if the generated controller should be a resource controller
--api Indicates if the generated controller should be an API resource controller
-R, --requests Create new form request classes and use them in the resource controller
控制器
./vendor/bin/larapack make:controller NAME
Arguments:
name The name of the controller class
Options:
--api Exclude the create and edit methods from the controller.
-i, --invokable Generate a single method, invokable controller class.
-m, --model[=MODEL] Generate a resource controller for the given model.
-r, --resource Generate a resource controller class.
-R, --requests Generate FormRequest classes for store and update.