Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kristi11 committed Jan 22, 2025
1 parent 2b82129 commit 558918d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
20 changes: 20 additions & 0 deletions app/Filament/Plugins/BreezyCore.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Filament\Plugins;

use Filament\Forms;

class BreezyCore extends \Jeffgreco13\FilamentBreezy\BreezyCore
{
public function getAvatarUploadComponent()
{
$fileUpload = Forms\Components\FileUpload::make('avatar_url')
->disk('DO-SPACES')
->label(__('filament-breezy::default.fields.avatar'))
->avatar();

return is_null($this->avatarUploadComponent) ? $fileUpload : $this->evaluate($this->avatarUploadComponent, namedInjections: [
'fileUpload' => $fileUpload,
]);
}
}
3 changes: 2 additions & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ class User extends Authenticatable implements FilamentUser, HasAvatar

public function getFilamentAvatarUrl(): ?string
{
return $this->avatar_url ? Storage::url($this->avatar_url) : null ;
return $this->avatar_url ? Storage::disk('DO-SPACES')
->url($this->avatar_url) : null;
}
public function addresses(): HasMany
{
Expand Down
4 changes: 2 additions & 2 deletions app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public function panel(Panel $panel): Panel
->associateItemsWithTheirGroups(),
//FilamentSpatieLaravelBackupPlugin::make(),
ThemesPlugin::make(),
BreezyCore::make()
->avatarUploadComponent(fn() => FileUpload::make('avatar_url')->disk('DO-SPACES'))
\App\Filament\Plugins\BreezyCore::make()
->avatarUploadComponent(fn($fileUpload) => $fileUpload->disableLabel())
->myProfile(
// shouldRegisterUserMenu: false,
// Sets the 'account' link in the panel User Menu (default = false)
Expand Down

0 comments on commit 558918d

Please sign in to comment.