'float', 'latitude' => 'float', 'balance' => 'float', 'active' => 'int', 'town_id' => 'int', 'number_super' => 'int', 'number_geoBysuper' => 'int' ]; protected $dates = [ 'date_created', 'open_hours', 'close_hours' ]; protected $hidden = [ 'encrypted_password' ]; protected $fillable = [ 'uid', 'firstname', 'lastname', 'email', 'longitude', 'latitude', 'adresse', 'balance', 'encrypted_password', 'salt', 'active', 'date_created', 'open_hours', 'close_hours', 'town_id', 'number_super', 'number_geoBysuper' ]; public function town() { return $this->belongsTo(Town::class); } /** * Find the user instance for the given username. * * @param string $username * @return \App\Models\User */ public function findForPassport($username) { return $this->where('email', $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; } }