hasMany() relation #1624
Replies: 2 comments
-
Can you confirm which version you're using please :) Is your table based off the "User" model? Rather than adding a "join" to your builder(), add a "with" statement, so that it joins the relationship in an Eloquent manner. Next, use setAdditionalSelects() in your configure() method to ensure that relevant fields are selected from the related models. Finally, you should then be able to use a "label()" rather than a format() column to achieve what you want, which will avoid the package trying to figure out the table
|
Beta Was this translation helpful? Give feedback.
-
I use version 3 .
|
Beta Was this translation helpful? Give feedback.
-
hello , Thank you for always answering our questions . I hope that you will help me in this matter because I have been struggling for several days and I could not find the right answer even by searching
i have an account model that belong to user mode :
and user hasMany accounts :
account have two type in my database : "binary" and "invest"
I want to display the binary account and invest of each user in two different columns in the users table:
But I get this error:
Rappasoft\LaravelLivewireTables\Views\Column::setTable(): Argument #1 ($table) must be of type string, null given, called in /home/mahdi/projects/vision/vendor/rappasoft/laravel-livewire-tables/src/Traits/Helpers/ColumnHelpers.php on line 26
I even used join in the builder, but I didn't get any results. Please help, thank you
Beta Was this translation helpful? Give feedback.
All reactions