darwin's avatar
Level 11

What does it mean when I publish assets and resources

Hello,

I am trying to understand the concept and I am having a hard time.

When I am developing a package what exactly am I doing when I make something published.

For example this part:

https://laravel.com/docs/5.5/packages#publishing-file-groups

What am I allowing exactly? Why would I publish anything? The more info someone can give me the better :)

I have tried googling and searching but I am having no luck.

Thank you in advance and sorry if this is a repost (in which case could I get a link to the original :) )

0 likes
4 replies
topvillas's avatar
Level 46

It copies things from the package into more convenient directories where the consumer can change or configure things safely.

1 like
darwin's avatar
Level 11

Thank you!

How does Laravel know to read the files in the new location instead of the ones in the package? Does it create a Symlink?

1 like
Cronix's avatar

I believe it just automatically checks. Like it checks to see if there is a view in /resources/views/vendor/[package-name]/view-name, and if it doesn't exist it loads the same view from your original package (/vendor/[package-name]/view-name. This allows the developer to customize the package views without altering the package itself. This is highly preferred to the developer editing the files in /vendor/[package-name] directly, where the custom changes they made would get overridden when updating the package through composer. Same with config files, etc.

1 like
darwin's avatar
Level 11

Thank you both. That helped a lot.

Please or to participate in this conversation.