Because in the comments that you asked yet, how it works in the Laravel method, so here is an alternative solution next to strtolower and mb_strtolower , which also works great.
You must add namsepace before the method so that PHP and Laravel can find this method.
So, if you want to use it in Blade, do the following:
<img src="images/{{ Illuminate\Support\Str::lower($matchup->visitorTeam) }}sml.jpg">
If you want to use it in a controller or model, you need to add a namespace where Str is on top:
use Illuminate\Support\Str;
After that, you can call it without a namespace prefix:
Str::lower($test);
Zeussi
source share