mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 22:19:26 +01:00
26 lines
595 B
PHP
26 lines
595 B
PHP
<?php
|
|
|
|
namespace App\AvatarProviders;
|
|
|
|
use Filament\AvatarProviders\Contracts\AvatarProvider;
|
|
use Illuminate\Contracts\Auth\Authenticatable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PelicanAvatarProvider implements AvatarProvider
|
|
{
|
|
public function get(Model|Authenticatable $record): 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 url('/pelican.svg');
|
|
}
|
|
}
|