Jonjie
1 month ago
258
6
Laravel

How to change image directory in spatie media library?

Posted 1 month ago by Jonjie

I'm new to this package since I usually use the image intervention. So the problem is whenever I save an image, it is saving in storage directory instead of in public directory. Please see my code below for saving.

$user->addMediaFromRequest('avatar')->toMediaCollection('avatars');

Package:

https://spatie.be/docs/laravel-medialibrary/v7/introduction

Please sign in or create an account to participate in this conversation.