G
G
Good Samaritan2020-01-28 11:05:57
Laravel
Good Samaritan, 2020-01-28 11:05:57

How to get user_name by user_id in view?

How to get username by userid in view?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Suha, 2020-01-28
@djamali

The view should already have a user object. An option like {{ User::find($id)->name }} in a view does not need to be used. It should be like this {{ $user->name }} where $user already exists inside the view, i.e. received from the controller. In general, the question certainly shines with information

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question