Biscoff Frappe
Elite
I have a colum that contains multiple names. How will I be able to display them all in a view file separated by new lines? using laravel.
$names = DB::table('users')->pluck('name');
$namesString = implode("\n", $names->toArray());
return view('names')->with('namesString', $namesString);
nl2br function to replace new lines with HTML line breaks.{{ nl2br(e($namesString)) }}