Hi All,
I am Using Spatie Media Library and having trouble uploading images to a production app.
I Have 2 identical forge websites pulling from the same GitHub repo one will allow me to upload files and the other returns the following error.
production.ERROR: Url cannot be reached {"userId":1,"exception":"[object] (Spatie\MediaLibrary\MediaCollections\Exceptions\UnreachableUrl(code: 0): Url `**/storage/docs/test/bsqXo4H5nAoNKXCDS2iseNe3heCTtNGbe2w0Lx4w.pdf` cannot be reached at **/vendor/spatie/laravel-medialibrary/src/MediaCollections/Exceptions/UnreachableUrl.php:9)
code in question however this works locally and in one other production app.
$fileName = str_replace([" ", '-'], "_", $file->getClientOriginalName());
$fileHash = Storage::disk('documents')->putFile(substr($fileName, 0, strpos($fileName, '.')), $file);
$media = $this->model->addMediaFromUrl(Storage::disk('documents')->url($fileHash))->toMediaCollection($this->collection);