Closed kamihouse closed 7 years ago
If I use the below example, its ok:
public function show($tenant, Fornecedor $fornecedor)
{
return $fornecedor;
}
Can it be a problem with the grouping routes?
This is strictly related to Laravel routing system, and therefore has nothing to do with Tenanti.
Hello. I'm developing an API using Laravel's Resource Controllers features and using Orchestral Multi-tenant Database Schema Manager as a Single Database.
In my control methods I am using the Route Model Binding to injecting a model ID to a route or controller action, often query to retrieve the model that corresponds to that ID.
Some relevant routes from my API:
An example of my API route file:
These are some methods of my FornecedorController.php:
However when trying to access the URL that uses the Route Model Binding I get the following error:
URL: /api/v1/1/fornecedores/1
And this is the all trace:
I could verify that there is apparently a confusion when retrieving the parameters. When inspecting route parameters, this is the result:
URL: /api/v1/1/fornecedores/18
Result:
And when trying to retrieve the provider's route:
URL: /api/v1/1/fornecedores/18
Result:
Even using bind the parameter I get is not correct.
The other routes that do not use a second parameter are ok.
Thanks!