Laravel Bagisto custom theme Vite problum (Images not render)

I am trying to create custom theme for my Laravel Bagisto2.0 store, I have followed Bagisto2.0 official Doc for creating custom theme.

I have done every thing as they mentioned, the theme has been changed successfully but on home page I am getting this error in console “Uncaught Error: Extension Error: The validator ‘all’ must be a function.”

I think this is Vite error. I am not getting any error in laravel logs file.

I tried to create custom theme in laravel bagisto.

I follow these sources:

https://bagisto.com/en/create-custom-theme-in-bagisto/

I have follow these steps :

Step 1 : I have cloned the Shop package and modify the changes requested for my new one As we have created by the name of WtShop.

Step 2 : The vite setup inside my new package in the vite.config.js file as shown below

import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import laravel from "laravel-vite-plugin";
import path from "path";

export default defineConfig(({ mode }) => {
    const envDir = "../../../";

    Object.assign(process.env, loadEnv(mode, envDir));

    return {
        build: {
            emptyOutDir: true,
        },

        envDir,

        server: {
            host: process.env.VITE_HOST || "localhost",
            port: process.env.VITE_PORT || 5173,
        },

        plugins: [
            vue(),

            laravel({
                hotFile: "../../../public/wtshop-wtshop-vite.hot",
                publicDirectory: "../../../public",
                buildDirectory: "themes/shop/wtshop/build",
                input: [
                    "src/Resources/assets/css/app.css",
                    "src/Resources/assets/js/app.js",
                ],
                refresh: true,
            }),
        ],

        experimental: {
            renderBuiltUrl(filename, { hostId, hostType, type }) {
                if (hostType === "css") {
                    return path.basename(filename);
                }
            },
        },
    };
});

Step 3 : I have added new theme config in config/themes.php file as below

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Shop Theme Configuration
    |--------------------------------------------------------------------------
    |
    | All the configurations are related to the shop themes.
    |
    */

    'shop-default' => 'default',

    'shop' => [
        'default' => [
            'name'        => 'Default',
            'assets_path' => 'public/themes/shop/default',
            'views_path'  => 'resources/themes/default/views',

            'vite'        => [
                'hot_file'                 => 'shop-default-vite.hot',
                'build_directory'          => 'themes/shop/default/build',
                'package_assets_directory' => 'src/Resources/assets',
            ],
        ],
        // This is my theme
        'wttheme' => [
            'name'        => 'wttheme',
            'assets_path' => 'public/themes/shop/wtshop',
            'views_path'  => 'resources/themes/wttheme/views',

            'vite'        => [
                'hot_file'                 => 'wtshop-wtshop-vite.hot',
                'build_directory'          => 'themes/shop/wtshop/build',
                'package_assets_directory' => 'src/Resources/assets',
            ],
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Admin Theme Configuration
    |--------------------------------------------------------------------------
    |
    | All the configurations are related to the admin themes.
    |
    */

    'admin-default' => 'default',

    'admin' => [
        'default' => [
            'name'        => 'Default',
            'assets_path' => 'public/themes/admin/default',
            'views_path'  => 'resources/admin-themes/default/views',

            'vite'        => [
                'hot_file'                 => 'admin-default-vite.hot',
                'build_directory'          => 'themes/admin/default/build',
                'package_assets_directory' => 'src/Resources/assets',
            ],
        ],
    ],
];

Step 4 : Add package in composer.json file into autoload array :

"Webkul\WtShop\": "packages/Webkul/WtShop/src",

Setp 5: Add ModuleServiceProvider into config/concord.php file :

WebkulWtShopProvidersModuleServiceProvider::class,

Step 6 : Add WtShopServiceProvider in config/app.php file inside providers array :

WebkulWtShopProvidersWtShopServiceProvider::class,

Step 7 : Changes in bagisto/packages/Webkul/WtShop/src/Routes/breadcrumbs.php file because when run composer dump-autoload command getting error ‘Breadcrumb name “shop.customer.profile.index” has already been registered’ :

<?php

use DiglacticBreadcrumbsBreadcrumbs;
use DiglacticBreadcrumbsGenerator as BreadcrumbTrail;

/**
 * Profile routes.
 */
Breadcrumbs::for('wtshop.customer.profile.index', function (BreadcrumbTrail $trail) {
    $trail->push(trans('shop::app.customer.account.profile.index.title'), route('wtshop.customer.profile.index'));
});

Breadcrumbs::for('wtshop.customer.profile.edit', function (BreadcrumbTrail $trail) {
    $trail->parent('wtshop.customer.profile.index');
});

/**
 * Order routes.
 */
Breadcrumbs::for('wtshop.customer.orders.index', function (BreadcrumbTrail $trail) {
    $trail->parent('wtshop.customer.profile.index');

    $trail->push(trans('shop::app.customer.account.order.index.page-title'), route('wtshop.customer.orders.index'));
});

Breadcrumbs::for('wtshop.customer.orders.view', function (BreadcrumbTrail $trail, $id) {
    $trail->parent('wtshop.customer.orders.index');
});

/**
 * Downloadable products.
 */
Breadcrumbs::for('wtshop.customer.downloadable_products.index', function (BreadcrumbTrail $trail) {
    $trail->parent('wtshop.customer.profile.index');

    $trail->push(trans('shop::app.customer.account.downloadable_products.title'), route('wtshop.customer.downloadable_products.index'));
});

/**
 * Wishlists.
 */
Breadcrumbs::for('wtshop.customer.wishlist.index', function (BreadcrumbTrail $trail) {
    $trail->parent('wtshop.customer.profile.index');

    $trail->push(trans('shop::app.customer.account.wishlist.page-title'), route('wtshop.customer.wishlist.index'));
});

/**
 * Reviews.
 */
Breadcrumbs::for('wtshop.customer.reviews.index', function (BreadcrumbTrail $trail) {
    $trail->parent('wtshop.customer.profile.index');

    $trail->push(trans('shop::app.customer.account.review.index.page-title'), route('wtshop.customer.reviews.index'));
});

/**
 * Addresses.
 */
Breadcrumbs::for('wtshop.customer.addresses.index', function (BreadcrumbTrail $trail) {
    $trail->parent('wtshop.customer.profile.index');

    $trail->push(trans('shop::app.customer.account.address.index.page-title'), route('wtshop.customer.addresses.index'));
});

Breadcrumbs::for('wtshop.customer.addresses.create', function (BreadcrumbTrail $trail) {
    $trail->parent('wtshop.customer.addresses.index');

    $trail->push(trans('shop::app.customer.account.address.create.page-title'), route('wtshop.customer.addresses.create'));
});

Breadcrumbs::for('wtshop.customer.addresses.edit', function (BreadcrumbTrail $trail, $id) {
    $trail->parent('wtshop.customer.addresses.index');

    $trail->push(trans('shop::app.customer.account.address.edit.page-title'), route('wtshop.customer.addresses.edit', $id));
});

Step 8 : Override the view files inside new package by WtShopServiceProvider ::

<?php

namespace WebkulWtShopProviders;

use IlluminatePaginationPaginator;
use IlluminateRoutingRouter;
use IlluminateSupportFacadesBlade;
use IlluminateSupportFacadesRoute;
use IlluminateSupportServiceProvider;
use WebkulCoreTree;
use WebkulShopHttpMiddlewareAuthenticateCustomer;
use WebkulShopHttpMiddlewareCurrency;
use WebkulShopHttpMiddlewareLocale;
use WebkulShopHttpMiddlewareTheme;

class WtShopServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot(Router $router)
    {
        /* loaders */
        Route::middleware('web')->group(__DIR__.'/../Routes/web.php');
        Route::middleware('web')->group(__DIR__.'/../Routes/api.php');

        $this->loadMigrationsFrom(__DIR__.'/../Database/Migrations');
        // I have changed from shop to wtshop this
        $this->loadTranslationsFrom(__DIR__.'/../Resources/lang', 'wtshop');
        $this->loadViewsFrom(__DIR__.'/../Resources/views', 'wtshop');

        /* aliases */
        $router->aliasMiddleware('currency', Currency::class);
        $router->aliasMiddleware('locale', Locale::class);
        $router->aliasMiddleware('customer', AuthenticateCustomer::class);
        $router->aliasMiddleware('theme', Theme::class);

        $this->publishes([
            dirname(__DIR__).'/Config/imagecache.php' => config_path('imagecache.php'),
        ]);

        // I have added this
        $this->publishes([
            __DIR__ . '/../Resources/views' => resource_path('themes/wttheme/views'),
        ]);

        /* View Composers */
        $this->composeView();

        /* Paginator */
        Paginator::defaultView('shop::partials.pagination');
        Paginator::defaultSimpleView('shop::partials.pagination');

        Blade::anonymousComponentPath(__DIR__.'/../Resources/views/components', 'shop');

        /* Breadcrumbs */
        require __DIR__.'/../Routes/breadcrumbs.php';

        $this->app->register(EventServiceProvider::class);
    }

    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        $this->registerConfig();
    }

    /**
     * Bind the the data to the views.
     *
     * @return void
     */
    protected function composeView()
    {
        view()->composer('shop::customers.account.partials.sidemenu', function ($view) {
            $tree = Tree::create();

            foreach (config('menu.customer') as $item) {
                $tree->add($item, 'menu');
            }

            $tree->items = core()->sortItems($tree->items);

            $view->with('menu', $tree);
        });
    }

    /**
     * Register package config.
     *
     * @return void
     */
    protected function registerConfig()
    {
        $this->mergeConfigFrom(
            dirname(__DIR__).'/Config/menu.php',
            'menu.customer'
        );
    }
}

Step 9 : Run npm Commands

1. npm install

Output is :

2. npm run build

Output is :

Step 10 : Run php artisan vendor:publish –force command
output :

Step 11 : Select theme in Channel and save changes :

The theme is saved successfully, but when I hit base url I am getting this error in console :

Step 11 : Hit base url on browser :

I am getting js error in console

Uncaught Error: Extension Error: The validator 'all' must be a function.
    guardExtend vee-validate.esm.js:100
    defineRule vee-validate.esm.js:84
    install vee-validate.js:45
    install vee-validate.js:44
    use runtime-core.esm-bundler.js:2984
    <anonymous> app.js:91
    <anonymous> app.js:91

I can’t found What is missing

Thank you !

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật