Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disk and visibility configuration for avatars #51

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ use Joaopaulolndev\FilamentEditProfile\Pages\EditProfilePage;
])
```

If needed you can define the disk and visibility of the avatar image. In the config file add the following:

[config/filament-edit-profile.php](config/filament-edit-profile.php)

```php
return [
'disk' => 's3',
'visibility' => 'public',
];
```


## Profile Avatar

![Screenshot of avatar Feature](https://raw.githubusercontent.com/joaopaulolndev/filament-edit-profile/main/art/profile-avatar.png)
Expand Down
2 changes: 2 additions & 0 deletions src/Livewire/EditProfileForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public function form(Form $form): Form
->label(__('filament-edit-profile::default.avatar'))
->avatar()
->imageEditor()
->disk(config('filament-edit-profile.disk', 'public'))
->visibility(config('filament-edit-profile.visibility', 'public'))
->directory(filament('filament-edit-profile')->getAvatarDirectory())
->rules(filament('filament-edit-profile')->getAvatarRules())
->hidden(! filament('filament-edit-profile')->getShouldShowAvatarForm()),
Expand Down