Use the @googlefonts Blade directive
mainTo load fonts in your application, register the Google Fonts embed URL in your configuration and use the @googlefonts Blade directive in your layout.
By default, the package inlines the CSS to reduce network round-trips. You can load the default font by calling @googlefonts without arguments, or specify a specific key defined in your config.
// config/google-fonts.php
return [
'fonts' => [
'default' => 'https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,700;1,400;1,700&display=swap',
'code' => 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,700;1,400&display=swap',
],
];{{-- resources/views/layouts/app.blade.php --}}
<head>
{{-- Loads Inter (the 'default' key) --}}
@googlefonts
{{-- Loads IBM Plex Mono (the 'code' key) --}}
@googlefonts('code')
</head>