Replies: 2 comments
-
|
The problem occurs because you published the views. This is not ideal for future maintenance. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I had this bug and found @luanfreitasdev comment to be unhelpful. Fix that worked for me was to add an id column to my sql query -- any unique id will do -- and then add that column to the fields
powergrid seems to expect an id column at all times, even when not using checkboxes. Was the view "published"? Not in my case. |
Beta Was this translation helpful? Give feedback.
0 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.
-
Livewire PowerGrid version
v6.1.0
Livewire version
v3.5.16
Laravel version
v11.34.2
Which PHP version are you using?
PHP 8.3
Which Theme are you using?
Bootstrap 5
Have you published the resource files and customized them? (php artisan vendor:publish)
Yes
What is the problem?
Created a query builder component with php artisan powergrid:create . When I try to display the view I get an error php Undefined property: stdClass::$id. I have tried using "id" as the column name and changing the $primaryKey and $sortField. I have tried >select(['id']) to the query. The error occurs at resources/views/vendor/livewire-powergrid/components/row.blade.php&line=22.
Code snippets
return DB::table('customer');
How do you expect it to work?
Display table without error.
Please confirm (incomplete submissions will not be addressed)
Beta Was this translation helpful? Give feedback.
All reactions