Replies: 1 comment
-
You can also have a main database that stores media models for different model on different databases, that would be done like this
And set this Model as default media model in the media library config... In that case, every model would store and retrieve it from you app database |
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
-
So our Laravel app uses two databases:
app
andresources
. Both store various models which will use laravel-medialibrary egapp
db storesuser
models andresources
db stores models forstory
,quotes
etcI've created the
media
db table in both databases.I haven't overridden the default Media class, so that's still using the default connection (
app
). I don't see a way to have a second (custom) Media class for the resources models (egstories
).Yet the following puts an entry into the
resources
db:That's not a problem — it's actually what I'd hope for, I guess, but I'm confused whether I'm going about this the right way (particularly having the
media
db table in both databases)?Beta Was this translation helpful? Give feedback.
All reactions