laravel get user name by id in blade code example
Example: how to print user name in by passing created by id
public function index()
{
$users = User::all();
$products= Product::all();
return view('products.index',compact('products', 'users'));
}