I have two (2) tables naming student and teacher. I'm using it for two separated table for requirements.
Student:
username | password | email | created | modified ( columns )
Teacher:
username | password | email | majorsub | etc.. ( columns )
$this->loadComponent('Auth',[
'authenticate'=>[
'Teacher'=>[
'authenticate'=>[
'Basic' => ['userModel' => 'Teachers'],
'Form' => ['userModel' => 'Teachers']
],
'loginAction' => [
'controller' => 'Teachers',
'action' => 'login'
],
[
'loginRedirect' => [
'controller' => 'Teachers',
'action' => 'profile'
],
'logoutRedirect' => [
'controller' => 'Pages',
'action' => 'home'
]
]
],
'Students'=>[
'authenticate'=>[
'Basic' => ['userModel' => 'Students'],
'Form' => ['userModel' => 'Students']
],
'loginAction' => [
'controller' => 'Students',
'action' => 'login',
],
[
'loginRedirect' => [
'controller' => 'Students',
'action' => 'profile'
],
'logoutRedirect' => [
'controller' => 'Pages',
'action' => 'home'
]
]
]
]);
I got an error : Authentication adapter "Teachers" was not found. How to create for this and is this right for two table login Auth configuration..