I'm trying to understand what it does, and how you can take advantage of the php artisan vendor:publish
. I've been going through the Laravel documentation, but I can't find anything concrete about it. Where examples are put (in notifications and elsewhere), the documentation assumes that you already know what it does and why it's there. It is very brief.
I would be grateful if someone could point me to a website or material with explanations as detailed as possible to understand this command.
A simple explanation: this command allows us to copy directories and/or files from the original location of a third-party package (vendor folder) to our project, usually with one, two or three purposes:
Usually it is the creator of the package who defines what is "publishable" or in other words, what can be copied to the project folders.
When we install a third party package in Laravel:
We have a command, it will allow us to do the job of including resources associated with said package.
I mean that if we need to install a package whose operation depends on files such as:
All of these can be added to our project when performing the command:
After carrying out this step, if you have your project being tracked by a versioning controller such as Git , it should notify you that in certain paths (which may vary depending on the purpose of said package used) there are files that are not tracked or are untracked. which indicates that the previous action has generated one or more of these new ones within your project.
You can check the above because a notification similar to the following should appear on the console:
As such, this command will allow you to:
flag
--provider=[AQUI EL PROVEEDOR]
--env[AQUI EL AMBIENTE]
You can even have a list of available providers and tags available for you to publish just by running the command:
Means
vendor:publish