Get Name Of Table Column?
I think this is used to get data on the Table Column. From documentation
But i want little bit diffrent functionallity this is the code
Where i have name of user and Profile photo field
so i want that if user has no profile photo he will get defaultImageUrl
and i want the name of user insted of USER NAME
How can i get user name there
thank you in advance ❤️.
6 Replies
Solution
Like this?
i tried this but it is saying there is one correction
$record->name
thank you so much you are so fast @ZedoX thanks alot
Alternative: Or maybe just use default Laravel attribute getter to generate the avatar if no image is stored to the record.
I'd do the same, so i can rest assured no matter where i call the "$user->profile_photo_url", i'd get a url
that's impressive thanks
and not worry about setting a fallback default in every place