How to add laravel-medialibrary into Laravel/mongodb app ? #2990
Unanswered
sergeynilov
asked this question in
Q&A
Replies: 1 comment
-
Hello did you manage to make it work with mongodb? i also have the same problem :/ |
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.
-
I need to add spatie/laravel-medialibrary 10 into Laravel 9 app with jenssegers/mongodb:^3.9
I modified model app/Models/CMSItem.php decalaration :
But I got error :
Call to a member function prepare() on null
with code :
Reading docs https://spatie.be/docs/laravel-medialibrary/v10/advanced-usage/using-your-own-model
I try to define custom model in config/media-library.php :
and I created file app/Models/CustomMongoMedia.php with content:
But I got the same error.
If I modify this file:
But I got error:
In which way can it be salved ?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions