My current setup is that User
and Notification
are saved to my main database, Post
is saved to a different database.
User
and Notification
db connections are:
protected $connection = "main";
and Post
db connections is:
protected $connection = "second";
My notification table is saved to the main database. I have a notification class called "PostReplied" that takes a $post
as a parameter. so it's serialized when it's queued. When it started processing this job, it's trying to get the post from the "main" database instead of Post
's connection "second" database.
Any suggestions on how to make the notifications work with cross-database models?