mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 20:19:26 +01:00
35 lines
661 B
PHP
35 lines
661 B
PHP
<?php
|
|
|
|
namespace App\Extensions\Avatar\Schemas;
|
|
|
|
use App\Extensions\Avatar\AvatarSchemaInterface;
|
|
use App\Models\User;
|
|
|
|
class AppLogoSchema implements AvatarSchemaInterface
|
|
{
|
|
public function getId(): string
|
|
{
|
|
return 'appIcon';
|
|
}
|
|
|
|
public function getName(): string
|
|
{
|
|
return 'App Icon';
|
|
}
|
|
|
|
public function get(User $user): string
|
|
{
|
|
$logo = config('app.logo');
|
|
|
|
if (filled($logo)) {
|
|
if (str_starts_with($logo, 'http://') || str_starts_with($logo, 'https://')) {
|
|
return $logo;
|
|
}
|
|
|
|
return url($logo);
|
|
}
|
|
|
|
return '/pelican.svg';
|
|
}
|
|
}
|