<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
visual1 / statamic-font-awesome-fieldtype example snippets
// In a service provider
$this->app['events']->listen('fontawesome.icons.loading', function ($query) {
// Add custom icons to search results
return array_merge($query->icons, $customIcons);
});
// config/fontawesome.php
return [
'cache_duration' => 3600, // 1 hour instead of 30 minutes
'search_cache_duration' => 1800, // 30 minutes instead of 10
'max_search_results' => 50, // Reduce from 100 for faster loading
];
// Get augmented icon data
$iconData = $entry->augmentedValue('my_icon');
// Check if field has value
$hasIcon = $fieldtype->hasValue($value);
// Process field data
$processed = $fieldtype->process($data);