@php try { $fuentesConArchivo = \App\Models\Fuente::activas()->whereNotNull('archivo')->get(); } catch (\Exception $e) { $fuentesConArchivo = collect(); } @endphp @foreach($fuentesConArchivo as $fuente) @php $ext = strtolower(pathinfo($fuente->archivo, PATHINFO_EXTENSION)); $format = $ext === 'otf' ? 'opentype' : 'truetype'; @endphp @font-face { font-family: '{{ $fuente->css_family }}'; src: url('{{ public_path('fonts/' . $fuente->archivo) }}') format('{{ $format }}'); } @endforeach