For cakephp 3.6, cakephp.org tell how to customise user finder query for auth component at following link: link But I am not getting how to implement it? I have 'department_id' column in users table which belongs to departments table. I want to change the following query:
public function findAuth(){
$query
->select(['id', 'username', 'password'])->contain(['Departments'])
->where(['Users.active' => 1]);
return $query;
}
Will the above code work? Please tell me in which file I have to write the function? And what are other necessary steps to get it done, so that I get all user related info in $this->Auth->User ?