What seems to be the problem: so i have a livewire component, called JobsIndex
here is the code for it
<?php
namespace App\Http\Livewire;
use App\Models\Job;
use Livewire\Component;
use Livewire\WithPagination;
class JobsIndex extends Component
{
use WithPagination;
public $viewedJob;
public $jobs;
public function mount() {
$this->jobs = $this->jobs->items();
}
public function viewJob($job) {
$this->viewedJob = $job;
}
public function render()
{
return view('livewire.jobs-index');
}
}
the initial render is ok, but one problem that im having is with
public function viewJob($job) {
$this->viewedJob = $job;
}
this runs OK, but livewire keeps throwing errors that jobs is null, this is the image after the viewJob function was called
Thanks for your answer.