'int', 'longitude' => 'float', 'latitude' => 'float', 'active' => 'int', 'solde' => 'float', 'etat' => 'int', 'number_geoBysuper' => 'int', 'network_id' => 'int' ]; protected $dates = [ 'created', 'openHours', 'closeHours' ]; protected $hidden = [ 'encrypted_password' ]; protected $fillable = [ 'id', 'uid', 'firstname', 'adresse', 'lastname', 'email', 'encrypted_password', 'salt', 'longitude', 'latitude', 'phone', 'active', 'created', 'openHours', 'closeHours', 'solde', 'etat', 'network', 'country', 'code_parrain', 'category', 'code_membre', 'number_geoBysuper', 'network_id', 'code_dial', 'transactionNumber' ]; /** * Find the user instance for the given username. * * @param string $username * @return \App\Models\AgentPlus */ public function findForPassport($username) { return $this->where('email', $username)->orWhere('phone', $username)->orWhere('transactionNumber', $username)->first(); } /** * Validate the password of the user for the Passport password grant. * * @param string $password * @return bool */ public function validateForPassportPasswordGrant($password) { // return Hash::check($password, $this->password); $encrypted_password = base64_encode(sha1($password . $this->salt, true) . $this->salt); return $this->encrypted_password == $encrypted_password; } }