laravel-user-verification icon indicating copy to clipboard operation
laravel-user-verification copied to clipboard

support users in a different db connection

Open deyikong opened this issue 4 years ago • 0 comments

https://github.com/jrean/laravel-user-verification/blob/69527fdd760cdd29853846e03504b567aac58c8a/src/UserVerification.php#L271

https://github.com/jrean/laravel-user-verification/blob/69527fdd760cdd29853846e03504b567aac58c8a/src/UserVerification.php#L342

The above two places make it almost impossible to use a different connection than the default(actually it is possible to get around it by changing DB facade temporarily, but it's not the right way), so i would suggest changing the second constructor parameter to $connection,

  1. then at places where it needs schema, just do $connection->getSchemaBuilder(),
  2. and replace DB with $connections in the above places.
  3. And of course, you need to modify the service provider slightly as well. I would create a PR if you want it.

deyikong avatar Mar 26 '20 08:03 deyikong