No it will not overwrite. To overwrite you need to use vendor:publish --force
I am not asking about overwriting; see example:
When I do
vendor:publish with brand new package A and brand new package B, output is that
Copied Directory [/vendor/package/A/src/migrations] To [/database/migrations] Copied File [/vendor/package/B/src/config/configfile.php] To [/config/confgfile.php] Publishing Complete!
That is expected behaviour now I run
vendor:publish second time and this is the output
Copied Directory [/vendor/package/A/src/migrations] To [/database/migrations] Publishing Complete!
And question is: is this behaviour of command in question correct?
Yes. It did not overwrote the confgfile.php because you defined it as
$this->publishes([ __DIR__.'/path/to/config/confgfile.php' => config_path('confgfile.php'), ]);
I am asking other way around :) Is it correct from
vendor:publish overwrite already published stuff (views/migrations...)?
hey sorry man. here's my late late reply.
The console says "Copied Directory [/vendor/package/A/src/migrations] To [/database/migrations]" means it actually overwrote the files in the directory. Meaning it will not overwrite your existing migrations files or any other directories.
Also i like to note that if i were you i would place the migration folder and the config folder outside the src. When i develop i keep my classes only inside the src folder and set the composer to autoload psr-4 my src folder. So when composer dumps my autoload namespaces only the needed classes will be there. :)
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us