caffeinated/modules

Publishing views

tok3 opened this issue · 1 comments

tok3 commented

Hi there,
Is there a description how to publish views properly ?
Publishing by 'artisan vender:publish' works nice, but in which path I have to copy view files that Laravel takes the published views and not these from my Module/resouces/views folder. Views from packes will be published at "resouces/views/vendor/vendorname/packagename", is there an equivalent for modules ?

Nothing special going on - you would follow the same principles in your modules as you would a package - https://laravel.com/docs/5.7/packages#views

So, within your module's service provider you'd add something like the following to its boot() method:

$this->publishes([
    module_path('yourmodule', 'Resources/Views') => resource_path('views/module/yourmodule'),
], 'module');

Then you can run php artisan vendor:publish --tag=module and your views will be published to the views/module directory inside resources.