vendredi 3 août 2018

Laravel - Get users name from ID

I have a Laravel 5.6 app that is logging various information into a database table, I am then displaying this data in a HTML view. I am calling this view like this...

$logs = Log::all();
return view('logreport.index')->with('logs', $logs);

The table only contains the user ID, is there a way to get the users first name and last name for the users table? Or do I need to set a relationship up?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire