Why do you want a separate password column for an admin. vs a normal user? Have them both use the same 'password' column. Add another column that defines their role (admin or normal user).
//Users table
| id | name | password | admin |
------------------------------------------------------------------------------
| 1 | ImNormal | k1$i3JMYjwe | FALSE |
| 2 | AnotherNorm | MTp3gHvuv8 | FALSE |
| 3 | ImAdmin | $AdLnLjQl2j | TRUE |
or you can make a 'user_role_id' column instead of 'admin' that references a UserRoles table
//Users table
| id | name | password | user_role_id |
------------------------------------------------------------------------------
| 1 | ImNormal | k1$i3JMYjwe | 1 |
| 2 | AnotherNorm | MTp3gHvuv8 | 1 |
| 3 | ImAdmin | $AdLnLjQl2j | 2 |
//UserRoles table
| id | role |
------------------------------
| 1 | Normal |
| 2 | Admin |
| 3 | Subscriber | //ability to add this functionality later
Then your auth::atempt() would look like this:
public function login()
{
$input = $this->request->input();
//Check if logging in as admin first
if(Auth::attempt([
'username' => $input['username'],
'password' => $input['password'],
'user_id_role' => 2]
])
{
dd('Admin');
}
elseif(Auth::attempt([
'username' => $input['username'],
'password' => $input['password'],
'user_id_role' => 1]
])
{
dd('Normal User');
}
else
{
dd('login password or username failed');
}
}