-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.3] app:name - add file exists check for ModelFactory.php during namespace replacement #16592
Conversation
- add file exists check to ModelFactory.php file when performing app:name command
The |
Agreed, but in the case someone setting up a new app happens to remove the I think there are some legitimate use cases where someone might have trashed All that said, we're really talking about |
$modelFactoryFile = $this->laravel->databasePath().'/factories/ModelFactory.php'; | ||
|
||
if ($this->files->exists($modelFactoryFile)) { | ||
$this->replaceIn($modelFactoryFile, $this->currentRoot, $this->argument('name')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be simpler to do that check directly in replaceIn
function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is a good idea, ... updating PR.
- moved file existence check into the replaceIn() functionality of the command
fee6ba4
to
4914754
Compare
i'm curious, are there reasons that people change their App name, other than for purely cosmetic reasons? when this feature first appeared I used it on a new app, but quickly found it to be a little bit of a PITA while providing no real benefit. if it is purely cosmetic, I would almost argue that we get rid of it. |
I agree renaming App is generally not something I do or even recommend, but while the command is here might as well make it work I guess. I would be open to removing it or even extracting the whole functionality into a package that is maintained separately as it is a little bit of a time sink. If anyone wants to take that on ping me! |
Thanks for merging @taylorotwell. If in the future there needs to be a discussion on keeping/removing it, I can add to the argument there - we (at work) find it beneficial for a host of reasons. |
hey @ralphschindler, would you mind listing some of the reasons here for documentation? I'm also personally curious to hear what they are. Thanks! |
Fixes issue #16575