Force Laravel To Use MySQL For Authentication When MongoDB Is Set As Default
I thought by having the follwing line in
User.php was enough. Where else do I need to modify my DB connection?
protected $connection = 'mysql';
However, when attempting to reset my password, it's throwing an error. I see it's trying to communicate with my MongoDB DB, which is my default DB.
strtotime() expects parameter 1 to be string, array given in /var/www/html/ocd3/vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php line 126 at HandleExceptions->handleError('2', 'strtotime() expects parameter 1 to be string, array given', '/var/www/html/ocd3/vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php', '126', array('token' => array('_id' => object(MongoId), '
Someone faced this same problem here: https://laracasts.com/discuss/channels/laravel/designate-connection-for-password-resets-table-other-than-default
Basically: password_resets table differs from users table, so I guess you must set the desired connection in the config/auth.php file:
'passwords' => [ 'users' => [ 'provider' => 'users', 'email' => 'auth.emails.password', 'table' => 'CUSTOM_CONNECTION.password_resets', 'expire' => 60, ], ],
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms