PHP code example of enniosousa / google-fonts-field-for-backpack
1. Go to this page and download the library: Download enniosousa/google-fonts-field-for-backpack 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/ */
enniosousa / google-fonts-field-for-backpack example snippets
CRUD::addField([
'name' => 'subtitleFont',
'label' => "Subtitle Font",
'type' => 'google_fonts',
//'options'=> ['Lora', 'Jura', 'Muli:300'], //optional
//'allows_multiple'=> true, //optional, default is false
//'default' => 'Lora', //optional, it cans be string or array
]);
bash
php artisan vendor:publish --provider="Enniosousa\GoogleFontsFieldForBackpack\GoogleFontsFieldForBackpackServiceProvider"
php
<link href="https://fonts.googleapis.com/css?family=<?= implode('|', array_map('urlencode', (array) $model->subtitleFont))