P
P
pLavrenov2017-06-13 19:21:12
Laravel
pLavrenov, 2017-06-13 19:21:12

How to change Laravel validator model?

when checking for uniqueness in a table, the Laravel validator accesses the table directly by name and not through the model. But I use tenant models that change the connection to different bases. And it turns out that the validator is trying to make requests to the database using a standard connection. Please point me in which direction to think. and is it possible somehow to use not the name of the table but the model.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2017-06-13
@pLavrenov

Use the syntax connection_name.table_name
'email' => 'unique:connection.users,email_address'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question