Skip to content

Cannot access offset of type string on string error #1

@robs007

Description

@robs007

I'm trying to use your component but I must be missing something. I'm getting a offset error.
Here is the code I have.
...

class InspectionList extends Component
{
use WithPagination;
use LivewireMultiselect\HasSelect;

public $filter = 1;
public ?array $teamFilter = null;
public ?Collection $teams = null;

protected $listeners = ['select'];

public function render()
{
    $this->teams = collect([1=> '100 Hr', 2 => 'Annual']);
    $this->teamFilter = [1];
    return view('livewire.test',['inspections'=> Inspection::where('inspectiontype_id', $this->filter)->orderBy('date_performed','desc')->paginate(10)]);
}

}
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions