Closed frankpde closed 5 years ago
Suggest that we remove the check and make it mandatory to make the model - thoughts?
Would disagree- what if I want to create a controller that does not have a 1-1 relationship with a model?
Trying to think of an example of a controller that doesn’t have a model.
That being said if that’s the thought then we could add a simple check to see if the model has been defined and alter the replacements to suit.
Alternatively, we could look at introducing a different stub file?
The command artomator:controller checks whether a corresponding model exists. In case it does not, the user is asked whether the model should be generated or not. In case the user decides not to create the model (for whatever valid reason), the controller is created, but the views being loaded are missing the model prefix:
Expected result:
return view('controllerName.index')
Actual result:
return view('.models.index')
Additionally it would need to be considered what to do with the comments, or the model instantiation in the function store(), destroy() and update().