PHP code example of weble / laravel-adobe-typekit

1. Go to this page and download the library: Download weble/laravel-adobe-typekit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

weble / laravel-adobe-typekit example snippets


// config/adobe.typekit.php

return [
    'fonts' => [
        'default' => 'https://use.typekit.net/[project-id].css',
    ],
];

return [

    /*
     * Here you can register fonts to call from the @tyepkit Blade directive.
     * The typekit:fetch command will prefetch these fonts.
     */
    'fonts' => [
        'default' => 'https://use.typekit.net/[project-id].css',
    ],

    /*
     * This disk will be used to store local Adobe Typekit Fonts. The public disk
     * is the default because it can be served over HTTP with storage:link.
     */
    'disk' => 'public',

    /*
     * Prepend all files that are written to the selected disk with this path.
     * This allows separating the fonts from other data in the public disk.
     */
    'path' => 'fonts',

    /*
     * By default, CSS will be inlined to reduce the amount of round trips
     * browsers need to make in order to load the requested font files.
     */
    'inline' => true,

    /*
     * When something goes wrong fonts are loaded directly from Adobe.
     * With fallback disabled, this package will throw an exception.
     */
    'fallback' => ! env('APP_DEBUG'),

    /*
     * This user agent will be used to request the stylesheet from Adobe Tyepkit.
     * This is the Safari 14 user agent that only targets modern browsers. If
     * you want to target older browsers, use different user agent string.
     */
    'user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15',

];
blade
{{-- resources/views/layouts/app.blade.php --}}

<head>
    {{-- Loads default --}}
    @typekit

    {{-- Loads code project --}}
    @typekit('code')
</head>
bash
php artisan vendor:publish --provider="Weble\AdobeTypekit\AdobeTypekitServiceProvider" --tag="adobe-typekit-config"
blade
{{-- resources/views/layouts/app.blade.php --}}

<head>
    {{-- Loads Default --}}
    @typekit

    {{-- Loads code project --}}
    @typekit('code')
</head>
bash
php artisan typekit:fetch