Replies: 1 comment 3 replies
-
|
Reproduced on my side, I'm working on it |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Livewire PowerGrid version
6.5.0
Livewire version
3.6.4
Laravel version
12.32.5
Which PHP version are you using?
PHP 8.4
Which Theme are you using?
Tailwind
Have you published the resource files and customized them? (php artisan vendor:publish)
No
What is the problem?
Hello,
I've noticed a limitation in Livewire PowerGrid v6.5.0 and later when using detail() with collections or stdClass objects as the datasource.
Steps to reproduce
Create a PowerGridComponent with datasource() returning a collection of arrays or stdClass objects.
Define a detail() view using PowerGrid::detail()->view('your-view').
Load the table and try to expand the detail row.
Expected behavior
The detail view should render correctly for each row in the collection.
Actual behavior
PowerGrid throws the following errors:
Call to undefined method stdClass::toArray()
This happens even if each row in the collection has a valid id.
Using arrays, stdClass, or Fluent objects does not work.
The only workaround is to use Eloquent models with a valid id and toArray() method.
Additional context
This limitation blocks using in-memory collections with detail().
Using collections works fine for the main table, but detail() requires a model instance.
This seems to have started in v6.5.0.
Code snippets
// return this:
// Call to undefined method stdClass::toArray()
How do you expect it to work?
I expect that detail() should work with in-memory collections (arrays or stdClass objects) just like it works with Eloquent models. Specifically:
I should be able to return a collection of arrays or stdClass objects from datasource().
When I load the detail using detail(), PowerGrid throws the following error:
Call to undefined method stdClass::toArray()
In other words, PowerGrid should not require Eloquent models for detail views—it should accept any object or array with an id field.
I have tried clearing the cache, running php artisan config:clear and php artisan view:clear, and restarting the server, but the issue persists.
Please confirm (incomplete submissions will not be addressed)
Beta Was this translation helpful? Give feedback.
All reactions