The issue you're encountering is likely due to the way the value attribute is being set in your Blade template. The value attribute should be a scalar value, such as a string or a number, but it seems like it's being set to an object instead.
Here's a checklist to help you troubleshoot and resolve the issue:
-
Ensure Correct Data Type: Double-check that
$row->schoolIdis indeed a scalar value (like an integer or string) and not an object. From your description, it seems like it should be a number, but it's always good to verify. -
Blade Syntax: Make sure the Blade syntax is correctly outputting the value. The code you provided seems correct, but let's ensure there are no hidden issues:
<input type="checkbox" value="{{ $row->schoolId }}" wire:model="versionPackageReceiveds" wire:click="packageReceived({{ $row->schoolId }})" /> -
Check for JavaScript Interference: If you have any JavaScript that might be manipulating the DOM or the values of these inputs, ensure that it's not inadvertently setting the
valueto an object. -
Livewire Component: If you're using Livewire, ensure that the
versionPackageReceivedsproperty is correctly defined in your Livewire component and that it expects a scalar value. -
Debugging: Add some debugging output to verify the type and value of
$row->schoolId:<input type="checkbox" value="{{ $row->schoolId }}" wire:model="versionPackageReceiveds" wire:click="packageReceived({{ $row->schoolId }})" /> <p>School ID: {{ $row->schoolId }} (Type: {{ gettype($row->schoolId) }})</p>This will help you confirm that
$row->schoolIdis indeed what you expect it to be.
By following these steps, you should be able to identify and resolve the issue with the checkbox value being set to [object Object]. If the problem persists, consider checking the data source or any transformations applied to $row before it reaches the Blade template.