F
Filamentβ€’7mo ago
Shaung Bhone

Filament Spatie FileUpload with s3

I got issues with spatie file upload. It's coming from filepond. It's a livewire component. Where am I do wrong? Here is my configuration. I've set the following configuration:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"HEAD",
"GET",
"PUT",
"POST",
"DELETE"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"HEAD",
"GET",
"PUT",
"POST",
"DELETE"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]
.env
APP_URL=http://0.0.0.0
AWS_ACCESS_KEY_ID=AKIA5MO
AWS_SECRET_ACCESS_KEY=ErUxMtIeMA2ZzrSJb6hVl
AWS_DEFAULT_REGION=ap-southeast-1
AWS_BUCKET=bucket-adate
AWS_USE_PATH_STYLE_ENDPOINT=false
FILESYSTEM_DISK=s3
FILAMENT_FILESYSTEM_DISK=s3
APP_URL=http://0.0.0.0
AWS_ACCESS_KEY_ID=AKIA5MO
AWS_SECRET_ACCESS_KEY=ErUxMtIeMA2ZzrSJb6hVl
AWS_DEFAULT_REGION=ap-southeast-1
AWS_BUCKET=bucket-adate
AWS_USE_PATH_STYLE_ENDPOINT=false
FILESYSTEM_DISK=s3
FILAMENT_FILESYSTEM_DISK=s3
SpatieMediaLibraryFileUpload::make('media')
->required()
->label(__('Transaction Proof'))
->disk('s3')
->visibility('private')
->disableLabel(),
SpatieMediaLibraryFileUpload::make('media')
->required()
->label(__('Transaction Proof'))
->disk('s3')
->visibility('private')
->disableLabel(),
No description
Solution:
I got it.
Jump to solution
8 Replies
Shaung Bhone
Shaung Bhoneβ€’7mo ago
I still got the error.
Matthew
Matthewβ€’7mo ago
Bro what are you doing... please hide personal access keys!
Shaung Bhone
Shaung Bhoneβ€’7mo ago
Yes this not full access key.
Matthew
Matthewβ€’7mo ago
Ok nice. Safety concern, just saying πŸ˜…
Shaung Bhone
Shaung Bhoneβ€’7mo ago
Thanks
Matthew
Matthewβ€’7mo ago
As for your issue, if you try FileUpload, does it work? I think I know the issue. You need to install s3 composer require league/flysystem-aws-s3-v3 "^3.0" --with-all-dependencies
Shaung Bhone
Shaung Bhoneβ€’7mo ago
Yes I installed s3 FileUpload didn't work as well.
'temporary_file_upload' => [
'disk' => 's3', // Example: 'local', 's3' | Default: 'default'
'rules' => ['mimes:png,jpg', 'file'],
'temporary_file_upload' => [
'disk' => 's3', // Example: 'local', 's3' | Default: 'default'
'rules' => ['mimes:png,jpg', 'file'],
this is my config/livewire.php
Solution
Shaung Bhone
Shaung Bhoneβ€’7mo ago
I got it.