I have this Consultation:
$result = DB::table('cliente')
->select(DB::raw("CONCAT( TRIM(SUBSTRING( NombreCliente,1,1) ), TRIM(SUBSTRING( NombreCliente, locate( ' ',NombreCliente), 2) ) ) AS INICIALES"))
->get();
I would like to assign those values to each corresponding Variable and I do it in the following way:
foreach($result as $in)
{
<p>'.$in->INICIALES.'</p>
}
The problem is that I do not know how to do so that each name carries its corresponding initials, since it prints me 1 name with ALL the initials ...