Initial commit
This commit is contained in:
24
app/Services/CustomSocialShareService.php
Normal file
24
app/Services/CustomSocialShareService.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user