Spatie media library not Saving on S3

Hello I'm using spatie media library to save images on s3 disk Right now I'm using minio for testing in development This is my form Code:
Forms\Components\SpatieMediaLibraryFileUpload::make('image')
->disk(config('filesystems.default'))
->visibility('public')
Forms\Components\SpatieMediaLibraryFileUpload::make('image')
->disk(config('filesystems.default'))
->visibility('public')
This is my model:
class Brand extends Model implements HasMedia
{
use HasFactory , InteractsWithMedia;
}
class Brand extends Model implements HasMedia
{
use HasFactory , InteractsWithMedia;
}
Here's my aws .env file:
AWS_ACCESS_KEY_ID=sail
AWS_SECRET_ACCESS_KEY=password
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=local
AWS_ENDPOINT=http://localhost:9000
AWS_URL=http://localhost:9000/local
AWS_USE_PATH_STYLE_ENDPOINT=true
AWS_ACCESS_KEY_ID=sail
AWS_SECRET_ACCESS_KEY=password
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=local
AWS_ENDPOINT=http://localhost:9000
AWS_URL=http://localhost:9000/local
AWS_USE_PATH_STYLE_ENDPOINT=true
I can see in my network tab that file gets uploaded correctly to localhost:9000(minio) and I can see it's in tmp folder But laravel media library is not saving the uploaded data in the db so it feels like user hasn't uploaded anything When I use public file system driver it works like a charm but when I use S3 it's not working correctly I would appreciate if anyone could help me
2 Replies
LeandroFerreira
Try AWS_ENDPOINT=http://minio:9000
ghostrockz3d
ghostrockz3dOP2y ago
Thanks G
Want results from more Discord servers?
Add your server