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

Use Config to Generate Better Data #41

Merged
merged 1 commit into from
Oct 7, 2020

Conversation

daverogers
Copy link
Contributor

Apologies if this is too much change for one PR; I got on a bit of a run with the config feature (and a few things I needed to work with a very large database - specifically white/black listing) and thought I could also help fix some of the issues others had while I was in here.

Once I have your feedback and blessing, I can update the documentation here or in another PR.

  • Establish a config file (modelfromtable.php) that devs can use to preset configurations (which can be overridden by command line) - downside is debug, all, etc have to be explicitly set to true in command line
  • Use app/Models directory if Laravel 8+ (Laravel 8 Models #40)
  • New configuration to enable/disable timestamps ([Request] Disabling Timestamps #13)
  • Generating model docblocks (Satisfied, but still room to improvement #7)
  • New configuration to set delimiter (esp useful for tables with a lot of columns)
  • New configuration that sets overwrite to false by default, much safer for models that a dev has created and modified (force them to overwrite explicitly)
  • New configuration that sets $primaryKey - supports lambda to run database-specific query to obtain the primary key column
  • Expanded on previous $cast types, tried to make it a little smarter with regex
  • New configurations for whitelist and blacklist ("migrations" table included in config's blacklist by default, so devs have the choice to include it or not)
  • General stub cleanup

- Establish a config file (modelfromtable.php) that devs can use to preset configurations (which can be overridden by command line) - downside is debug, all, etc have to be explicitly set to true in command line
- Use `app/Models` directory if Laravel 8+ (laracademy#40)
- New configuration to enable/disable timestamps (laracademy#13)
- Generating model docblocks (laracademy#7)
- New configuration to set delimiter (esp useful for tables with a lot of columns)
- New configuration that sets `overwrite` to `false` by default, much safer for models that a dev has created and modified (force them to overwrite explicitly)
- New configuration that sets `$primaryKey` - supports lambda to run database-specific query to obtain the primary key column
- Expanded on previous `$cast` types, tried to make it a little smarter with regexp
- New configurations for whitelist and blacklist ("migrations" table included in config's blacklist by default, so devs have the choice to include it or not)
- General stub cleanup
@michael-mcmullen
Copy link
Collaborator

I think is a huge improvement! I will check everything out this weekend, but looking at the files I like what I see :)

@michael-mcmullen michael-mcmullen merged commit 80c9b8b into laracademy:master Oct 7, 2020
@daverogers daverogers deleted the add-config branch October 7, 2020 18:12
johnneijzen added a commit to johnneijzen/generators that referenced this pull request Nov 19, 2020
update README.MD to reflected laracademy#41 changes
@johnneijzen johnneijzen mentioned this pull request Nov 19, 2020
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 this pull request may close these issues.

2 participants