showing relationships in list operation? #1038
-
In
Here is the
I'd like to show that as two distinct columns in One thought I have is to create a new
I guess I could create an SQL TRIGGER to auto-update these newly created columns in the users table as well but the Are these my best options or is there a more straight forward way to do this that I'm not seeing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @prescriptionlifeline if you have your data loaded in the model (as part of a database column, or you manually add it with CRUD::column('currentDues.amountPaid');
CRUD::column('currentDues.yourComputedColumnName'); Another thing that I highly advise you to avoid having unexpected issues, or having to do additional configurations to the framework, it to use the conventions. Cheers |
Beta Was this translation helpful? Give feedback.
Hello @prescriptionlifeline
if you have your data loaded in the model (as part of a database column, or you manually add it with
$appends
https://laravel.com/docs/11.x/eloquent-serialization#appending-values-to-json ), you can just do:Another thing that I highly advise you to avoid having unexpected issues, or having to do additional configurations to the framework, it to use the conventions.
Laravel conventions is to name
relation_id
, souser_id
instead ofuserId
.Cheers