我已经使用以下命令在 Laravel 5.8 中创建了一个模块。
php artisan module:make leave
创建一个休假模块结构。但是如何使用 infyom(或其他)CRUD 生成器在此模块中创建 CRUD 操作?
我已经使用以下命令在 Laravel 5.8 中创建了一个模块。
php artisan module:make leave
创建一个休假模块结构。但是如何使用 infyom(或其他)CRUD 生成器在此模块中创建 CRUD 操作?
如果您尝试制作 amodel
而不是 amodule
您可以运行
php artisan make:model MyModel -a
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['all', 'a', InputOption::VALUE_NONE, 'Generate a migration, factory, and resource controller for the model'],
['controller', 'c', InputOption::VALUE_NONE, 'Create a new controller for the model'],
['factory', 'f', InputOption::VALUE_NONE, 'Create a new factory for the model'],
['force', null, InputOption::VALUE_NONE, 'Create the class even if the model already exists'],
['migration', 'm', InputOption::VALUE_NONE, 'Create a new migration file for the model'],
['pivot', 'p', InputOption::VALUE_NONE, 'Indicates if the generated model should be a custom intermediate table model'],
['resource', 'r', InputOption::VALUE_NONE, 'Indicates if the generated controller should be a resource controller'],
];
}