1

This is my Folder Structure I have used the default Naming ConventionI was trying to hash the password but it turns out that my entity file is not being included in the cakephp. Can someone help me why it is happening ???

When i run debug(get_included_file()); it does not show my User.php entity file. and my User.php file content is :

<?php
declare(strict_types=1);
namespace App\Model\Entity;

use Cake\ORM\Entity;
use Cake\Auth\DefaultPasswordHasher;


class User extends Entity
{

protected $_accessible = [
    'email' => true,
    'password' => true,
    'created' => true,
    'modified' => true,

];


protected $_hidden = [
    'password',
];

public function _setPassword($password) : ?string {

    if(strlen($password) > 0 ){

        return (new DefaultPasswordHasher())->hash($password);  
    }

}
}

0 Answers0