false ]; protected $fillable = [ 'password' ]; protected $casts = [ 'status' => 'bool' ]; protected static function booted() { static::creating(function ($customerLogin) { if (Hash::needsRehash($customerLogin->password)) { $customerLogin->password = Hash::make(trim($customerLogin->password)); } }); static::updating(function ($customerLogin) { if (Hash::needsRehash($customerLogin->password)) { $customerLogin->password = Hash::make(trim($customerLogin->password)); } }); } public function passwordMatch(string $password) { return Hash::check($password, $this->password); } /** * Customer BelongsTo relation * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function customer() { return $this->belongsTo(Customer::class); } /** * Brand BelongsTo relation * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function brand() { return $this->belongsTo(Brand::class); } }