Setting DB connection when resolving route models

I have read only routes such as /api/orders/{order} and I would like to point the model to the specific reader connection at the time Laravel hydrates the model in the route before it passes it into the controller such as public function show(Order $order) { ... }

I don't want it to affect all routes.

How would I do this?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GUSv9x
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time