You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you published the resource files and customized them? (php artisan vendor:publish)
No
What is the problem?
In PowerGrid v5.10, the $row for detail row, was an Eloquent model instance, which allowed direct access to relationships like this:
$row->matches->first()->result
After upgrading to v6.6, $row is now a stdClass.
This breaks relationship access and forces usage like:
$row['matches'][0]['result']
This change:
Breaks backward compatibility
Makes relationship handling inconsistent with how Eloquent normally works
Is not mentioned in the upgrade guide (if intentional)
Code snippets
Steps to reproduce
Define a relation in the model, e.g.:
public function matches(): HasMany
{
return $this->hasMany(Match::class)->latest();
}
In PowerGrid datasource:
public function datasource(): Builder
{
return Player::query()->with('matches');
}
In the Blade component:
{{ $row->matches->first()->result }}
✅ Works in v5.10
❌ Throws error in v6.6 (since $row is stdClass)
How do you expect it to work?
$row should be returned as an Eloquent model instance, just like in PowerGrid v5.10, so that relationships can be accessed using standard Eloquent syntax:
$row->matches->first()->result
Please confirm (incomplete submissions will not be addressed)
I have provided easy and step-by-step instructions to reproduce the bug.
I have provided code samples as text and NOT images.
I understand my bug report will be removed if I haven't met the criteria above.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Livewire PowerGrid version
v6.6.0
Livewire version
v3.6.4
Laravel version
v12.26.3
Which PHP version are you using?
PHP 8.2
Which Theme are you using?
Tailwind
Have you published the resource files and customized them? (php artisan vendor:publish)
No
What is the problem?
In PowerGrid v5.10, the $row for detail row, was an Eloquent model instance, which allowed direct access to relationships like this:
$row->matches->first()->result
After upgrading to v6.6, $row is now a stdClass.
This breaks relationship access and forces usage like:
$row['matches'][0]['result']
This change:
Code snippets
Steps to reproduce
Define a relation in the model, e.g.:
public function matches(): HasMany
{
return $this->hasMany(Match::class)->latest();
}
In PowerGrid datasource:
public function datasource(): Builder
{
return Player::query()->with('matches');
}
In the Blade component:
{{ $row->matches->first()->result }}
✅ Works in v5.10
❌ Throws error in v6.6 (since $row is stdClass)
How do you expect it to work?
$row should be returned as an Eloquent model instance, just like in PowerGrid v5.10, so that relationships can be accessed using standard Eloquent syntax:
$row->matches->first()->result
Please confirm (incomplete submissions will not be addressed)
Beta Was this translation helpful? Give feedback.
All reactions