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

Conversation

rpsimao
Copy link
Contributor

@rpsimao rpsimao commented Oct 22, 2024

Enhanced the avatar upload feature by allowing customization of the storage disk and visibility settings via configuration. Updated the README to reflect these new options and provide implementation guidance.

In the EditProfileForm.php added the 2 new directives in the FileUpload

 FileUpload::make('avatar_url')
    ->label(__('filament-edit-profile::default.avatar'))
    ->avatar()
    ->imageEditor()
    ->disk(config('filament-edit-profile.disk', 'public')) /*new disk directive*/
    ->visibility(config('filament-edit-profile.visibility', 'public')) /*new visibility directive*/
    ->directory(filament('filament-edit-profile')->getAvatarDirectory())
    ->rules(filament('filament-edit-profile')->getAvatarRules())
    ->hidden(! filament('filament-edit-profile')->getShouldShowAvatarForm()
),

in the config/filament-edit-profile.php

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

Updated the Readme.md to reflect this option

Enhanced the avatar upload feature by allowing customization of the storage disk and visibility settings via configuration. Updated the README to reflect these new options and provide implementation guidance.
@joaopaulolndev joaopaulolndev merged commit 42c2665 into joaopaulolndev:main Nov 2, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants