alexteie's avatar

alexteie started a new conversation+100 XP

2mos ago

Well please im little bit confused.

when i create an sfc component i wont get the data correct in the blade file? what do i wrong? $this->countTotal wont be displayed?

                <div class="widgets-icons bg-light-success text-success ms-auto">
                    <i class="fa-sharp fa-thin fa-people-group"></i>
                </div>
            </div>
            <div>
                <canvas id="contacten"></canvas>
            </div>
        </div>
    </div>
</div>
@endisland

<button wire:click="$refresh" wire:island="metrics" class="btn-sm btn-light">
    <i class="fa-sharp fa-thin fa-arrows-rotate"></i>
</button>
alexteie's avatar

alexteie wrote a reply+100 XP

3mos ago

i already solved it:) i had to create the path from orignal resources like this: /../packages/mypackages/resources/view/components that works.

alexteie's avatar

alexteie wrote a reply+100 XP

3mos ago

Hi Rihulva i put this in mijn module/serviceprovider but wont load?

    Livewire::addLocation(
        viewPath: resource_path(__DIR__ . '/../Resources/erp/components')
    );

this is what i have in mijn blade view: @livewire('subscription-list')

if i place is in the default Resources/View/components/ it will work but in mijn package it wont Unable to find component: [subscription-list]

alexteie's avatar

alexteie started a new conversation+100 XP

3mos ago

Hi with livewire 4 we can have single file in and component in Resources/View/components But i use my own packages and before i registerd them in the PackageService provider like this:

Livewire::component('profile.information', \Packages\myPackage\Livewire\Profile\Information::class);

with the new setup is there an easier way to load livewire components dynamic from my packages resources/view/components directory?

Kind regards Alex