© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•15mo ago•
3 replies
Douglas Gough

Livewire not finding component?

I've created a resource with a view page. When I visit the page I get an error saying Undefined variable $jobStatus. The error is generated from the blade view. I've gone over the code and can't see the error. It's probably something simple but I'm missing it. Any help is appreciated.


On the view page I'm calling a livewire component like this:

class ViewPanImport extends ViewRecord
{
    protected static string $resource = PanImportResource::class;

    protected static string $view = 'livewire.pan-import-progress';

}
class ViewPanImport extends ViewRecord
{
    protected static string $resource = PanImportResource::class;

    protected static string $view = 'livewire.pan-import-progress';

}


This is the view at the path resources/views/livewire/pan-import-progress.blade.php

<div wire:poll.5s="checkJobStatus">
    @if ($jobStatus === 0)
        <p>The import is in progress.</p>
        <x-filament::loading-indicator class="h-10 w-10 text-primary-500" />
    @elseif ($jobStatus === 1)
        <p>The import is finished.</p>
    @endif
</div>
<div wire:poll.5s="checkJobStatus">
    @if ($jobStatus === 0)
        <p>The import is in progress.</p>
        <x-filament::loading-indicator class="h-10 w-10 text-primary-500" />
    @elseif ($jobStatus === 1)
        <p>The import is finished.</p>
    @endif
</div>


And this is the component at app/livewire/PanImportProgress.php

namespace App\Livewire;

use Livewire\Component;
use App\Models\PanImport;

class PanImportProgress extends Component
{

    public $record;
    public $jobStatus;
    public $panImport;

    public function mount($record): void
    {
        $this->record = $record;
        $this->jobStatus = 0;
        $this->checkJobStatus();
    }

    public function checkJobStatus(): void
    {
        $this->panImport = PanImport::findOrFail($this->record);
        $this->jobStatus = $this->panImport->status;
    }


    public function render()
    {
        return view('livewire.pan-import-progress', [
            'jobStatus' => $this->jobStatus,
        ]);
    }
}
namespace App\Livewire;

use Livewire\Component;
use App\Models\PanImport;

class PanImportProgress extends Component
{

    public $record;
    public $jobStatus;
    public $panImport;

    public function mount($record): void
    {
        $this->record = $record;
        $this->jobStatus = 0;
        $this->checkJobStatus();
    }

    public function checkJobStatus(): void
    {
        $this->panImport = PanImport::findOrFail($this->record);
        $this->jobStatus = $this->panImport->status;
    }


    public function render()
    {
        return view('livewire.pan-import-progress', [
            'jobStatus' => $this->jobStatus,
        ]);
    }
}
Solution
Solved: I wasn't passing the record into the livewire component.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Livewire Component Not Working
FilamentFFilament / ❓┊help
2y ago
livewire component
FilamentFFilament / ❓┊help
4mo ago
Livewire custom component - Livewire Sortable
FilamentFFilament / ❓┊help
3y ago
Modal: Livewire component
FilamentFFilament / ❓┊help
2y ago