F
Filament12mo ago
ffffer.

Table with accessor content

Hi, in a table, I want to show the data contained in an accessor of the User model (multidimensional array). How can I do it? Alternatively I have been trying with Sushi, but the problem is that I can't pass the User ID to the Shushi model.
No description
No description
5 Replies
Quin.
Quin.12mo ago
Do you need to use query()? normally it would work like this
User::find(1)
User::find(1)
ffffer.
ffffer.OP12mo ago
Ok, thanks, but that's not the issue, the problem is that if I use User::find(1), the "balance" is a multidimensional array, could I use that array for the table? The other option, using Shushi, I don't know how to pass the User id to the model (in the model getRows() I have a funcion call that needs the User id)
Quin.
Quin.12mo ago
I am not sure if i understand you, but the balance table has a array? and you want that array assigneed to a user ? in this case user 1
ffffer.
ffffer.OP12mo ago
In User: public function getBalanceAttribute() { return GetBalance::run($this->id); } It returns (example): [ [ 'description' => 'Buy XXXX', amount => 100 ], [ 'description' => 'Buy YYYY', amount => 200 ] ] I want that the Table show that balance information
Quin.
Quin.12mo ago
Just make a relation between the 2 models that works
Want results from more Discord servers?
Add your server