Files
timebank-cc-public/app/Services/CustomSocialShareService.php
Ronald Huynen 2547717edb Initial commit
2026-03-23 21:37:59 +01:00

25 lines
726 B
PHP

<?php
namespace App\Services;
use Enflow\SocialShare\ConfiguredSocialShareService;
class CustomSocialShareService extends ConfiguredSocialShareService
{
public function icon(): ?string
{
// First check for custom icon in resources
$customIconPath = resource_path('views/vendor/social-share/icons/' . $this->name . '.svg');
if (file_exists($customIconPath)) {
return file_get_contents($customIconPath);
}
// Fallback to vendor package icon
if (file_exists($iconPath = __DIR__ . '/../../vendor/enflow/laravel-social-share/resources/icons/' . $this->name . '.svg')) {
return file_get_contents($iconPath);
}
return null;
}
}