pwweb / artomator

Artomator: Custom commands making life easier for Laravel.
MIT License
4 stars 1 forks source link

Standalone controller errors #13

Closed frankpde closed 5 years ago

frankpde commented 5 years ago

When creating standalone controllers without creating a model (i.e. for the standard laravel user model), the following issues are observed:

rabrowne85 commented 5 years ago

Is this when you use artomator:all or artomator:controller?

frankpde commented 5 years ago

When using artomator:controller

rabrowne85 commented 5 years ago

Going to need a little more information on this: what's the exact command that you ran to get the issue? Also, when prompted did you specify that a model should be created?

Looking at this if you run: artomator:controller Standalone/TestController then it works as expected. I think I'll adda a check in the function to see if the Controller words has been provided on the end of the name and then add if not.

frankpde commented 5 years ago

php artisan artomator:controller System/User and `$ A App\Models\System\User model does not exist. Do you want to generate it? (yes/no) [yes]:

no`

Must have been that the call was without the Controller. I'd agree to check for Controller and if missing adding it.

rabrowne85 commented 5 years ago

Yes, if the command is called without controller on the end then it won’t name it right. In the “all” command it’s added to the call for you.

However the Schema replacements still doesn’t make sense. If you select “no” to the model generation, the command should pick the stub file without the schema. Puzzling.

I’ve added the code to the dev branch for testing, but there is a breaking change at the moment, so double check the readme before using it.

rabrowne85 commented 5 years ago

This has been corrected in the latest version v0.2.0-beta.