Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dacapo:make:models command #196

Open
ucan-lab opened this issue Mar 21, 2022 · 0 comments · Fixed by #197
Open

Add dacapo:make:models command #196

ucan-lab opened this issue Mar 21, 2022 · 0 comments · Fixed by #197
Assignees

Comments

@ucan-lab
Copy link
Owner

ucan-lab commented Mar 21, 2022

Feature Command

$ php artisan dacapo:make:models
  • Read the table definition from schema.yml and execute the make:model command
  • Model class name is converted from snake case of table name to pascal case
  • Exclude Laravel's default tables. (users, password_resets, failed_jobs)
  • Exclusion table can be changed from config file
  • Command options follow the make:model options
  • --pivot option disabled (Cannot be specified individually)
  • --migration option disabled (Migration is executed by dacapo command)

Reference Command

$ php artisan make:model -h
Description:
  Create a new Eloquent model class

Usage:
  make:model [options] [--] <name>

Arguments:
  name                  The name of the class

Options:
  -a, --all             Generate a migration, seeder, factory, policy, and resource controller for the model
  -c, --controller      Create a new controller for the model
  -f, --factory         Create a new factory for the model
      --force           Create the class even if the model already exists
  -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 controller
  -R, --requests        Create new form request classes and use them in the resource controller
      --test            Generate an accompanying PHPUnit test for the Model
      --pest            Generate an accompanying Pest test for the Model
  -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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant