Open tabacitu opened 3 years ago
So strange... looks like addMedia
worked
and then getUrl
fails
So I guess your model is correct.
storage/app/public/somenumberhere/
Retrieving media docs:
https://docs.spatie.be/laravel-medialibrary/v8/basic-usage/retrieving-media/#main
Just after media is uploaded, in javascript, getPictures
must be called:
@pxpm, @promatik could you please help us out here? I'd really love to help @eduardoarandah finish up a first version of this package in the next few months, I think it'll be super-useful.
I think it's also a good opportunity for seeing how we can jump on a 3rd party add-on and help improve it, to the point where we can use it ourselves, add it to our add-ons page and tell Backpack devs to use it. Sort of an end-to-end help on developing Backpack add-ons, if you will 😀 It should help us hone how we build add-ons, which will be more and more important in v4.2 and v12.
Of course this doesn't take priority over Backpack 4.1 bugs, but I think it's something cool and constructive to work on, that would also greatly benefit the community. Let me know what you guys think about this, if you were able to install and use it and how you see it improved.
I haven't been able to successfully upload an item so far. I've followed the instructions in the README, created
ProductPictureController.php
to handle the uploads, with your default code (replaced MyModel with Product of course):index()
method works fine I think (returns 200);store()
method does NOT work, however, it throws and error when I try to upload an item:But the code inside the method itself is pretty freakin' simple:
As far as I can tell, it fails at getting the URL (the second line).
So my question is:
addMedia()
method, not upload the file ourselves then pass the file name? I don't see it used like this in the spatie docs;Cheers!