Answer the question
In order to leave comments, you need to log in
How to dynamically change setConnection() for a model in Laravel?
I have a controller with the following code:
private function unassignedLinks(Request $request)
{
return Link::whereNull('assignee_id')
->whereIn('status', [
Link::LINK_STATUS_APPROVED,
Link::LINK_STATUS_POST_ANSWER
])
->with('forum', 'order', 'question_account', 'answer_account')
->orderCorrectly()
->paginate(10, ['*'], 'uap')
->appends($request->except('uap'));
}
setConnection()
, so that data is returned from the database specified in the connection?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question