Как применить генератор CRUD для архитектуры модуля Laravel? - PullRequest
0 голосов
/ 29 марта 2019

Я создал модуль в Laravel 5.8 с помощью следующей команды.

php artisan module:make leave

Создана структура модуля отпуска.Но как я могу создать операцию CRUD в этом модуле с помощью infyom (или другого) генератора CRUD?

1 Ответ

0 голосов
/ 30 марта 2019

Если вы пытаетесь сделать model вместо module, вы можете запустить

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'],
        ];
    }

Исходный код

...