0

I'm using Laravel. I deleted the email field from the users table, then I created a separate table for emails. But when I try to send a password reset link using Laravel's built in authentication system, I got an error: Laravel can't find the email field in the users table.

Now I have to make it access the email from my new emails table, but I don't know how.

This is the error:

Illuminate\Database\QueryException SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email' in 'where clause' (SQL: select * from users where email = user1@yahoo.com limit 1)

jkdev
  • 11,360
  • 15
  • 54
  • 77
  • 1
    Please post the exception. – Thomas Sep 23 '19 at 17:35
  • Illuminate\Database\QueryException SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email' in 'where clause' (SQL: select * from `users` where `email` = user1@yahoo.com limit 1) – Farhad NA Sep 23 '19 at 17:37
  • Here's a [complete solution](https://stackoverflow.com/a/55676488/5581565) couldn't flag this as duplicate because am out of flags, if anyone can; please do – Salim Djerbouh Sep 23 '19 at 17:53
  • Possible duplicate of [Laravel Authentication - Email in different table](https://stackoverflow.com/questions/55600678/laravel-authentication-email-in-different-table) – Mateus Junges Sep 23 '19 at 18:41
  • Don't remove email and password fields from user table, if you do then you need to change default laravel structure for that by overriding all methods inside of default Auth classes. – Vipertecpro Sep 24 '19 at 06:33

0 Answers0