Updated 15 June 2026
Earlier, view files were copied into the resources directory and directly modified to customize the UI by overriding package views locally.
|
1 2 3 4 |
$this->publishes([ __DIR__.'/../Resources/views/shop/default/checkout/cart/index.blade.php' => resource_path('views/vendor/shop/checkout/cart/index.blade.php'), ]); |
After publishing, developers edited the copied files to customize the storefront or admin panel layout, behavior, and appearance as needed, without modifying the original package code.
Instead of copying files, register your custom view path using prependNamespace().
|
1 |
$this->app['view']->prependNamespace( 'shop', __DIR__.'/../Resources/views/shop/default' ); |
|
1 |
$this->app['view']->prependNamespace( 'admin', __DIR__.'/../Resources/views/admin/default' ); |
Suppose Bagisto loads the following view:
|
1 |
view('shop::checkout.cart.index'); |
Laravel will first check:
|
1 |
packages/Webkul/YourPackage/src/Resources/views/shop/default/checkout/cart/index.blade.php |
If the file exists, it will be used instead of the original Bagisto view.
|
1 2 3 4 5 6 7 8 9 10 11 |
Resources └── views ├── admin │ └── default │ └── sales └── shop └── default └── checkout └── cart └── index.blade.php |
prependNamespace() instead of manual file copying.If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.