Replies: 1 comment
-
I am facing same issue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
i have a problem with process media item for new (not exists records).
My function to upload file:
In my Model in registerMediaCollections and use function
onlyKeepLatest(1)
But this throw exception:
Error: Call to a member function getMedia() on null in vendor\spatie\laravel-medialibrary\src\MediaCollections\FileAdder.php:473
Problem is for $this->subject->fresh(); beacuse they not found records in database, but when i change my $model->exists for false I have another exception
TypeError: Spatie\MediaLibrary\Support\PathGenerator\DefaultPathGenerator::getBasePath(): Return value must be of type string, null returned in vendor\spatie\laravel-medialibrary\src\Support\PathGenerator\DefaultPathGenerator.php:44
When i add
after this:
https://github.com/spatie/laravel-medialibrary/blob/main/src/MediaCollections/FileAdder.php#L473
it works
it is good solution?
Beta Was this translation helpful? Give feedback.
All reactions