I have two laravel 5 apps using one database with two auth tables: users (internal use) and accounts (public app). On both apps, I am using a queue to send the password reset links. I have a queue:work command in the Kernel.php of both projects and a single jobs table. On the app with accounts table and Account model, I have in config/auth.php as 'model' => App\Account:class, 'table' => 'accounts'and on the app with users table and User model, I have in config/auth.php as 'model' => App\User::class and 'table' => 'users'. When a user in the internal app tries to recover password, instead the record of a student in the accounts table is rather selected. For example if the id = 10 in users table, laravel instead gets a record in accounts table with id = 10. I am using the ResetsPasswords trait for implementation. Sometimes it gets it correctly, other times it doesn't. Appreciate help on what i'm missing here.
NB:
I have cron entries as such:
* * * * * root cd /var/www/domain.com/public_html/ && /usr/bin/php artisan schedule:run >> /dev/null 2>&1
* * * * * root cd /var/www/domain.com/public_html/ && /usr/bin/php artisan schedule:run >> /dev/null 2>&1
Even though this issue occurs, the reset email is sent to the right email recipient except that the link is to the other app and addressed to the wrong person. In my emails.password, I have something like Dear $user->name. I don't know whether the issue arises because the queue:work command of one app is trying to send the job created by another app since I've just one jobs table. Does this mean that I've to maintain separate jobs table for both apps.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community