HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/cafe-de-bout.komma.pro/vendor/komma/kms/src/Core/Attributes/Password.php
<?php
namespace Komma\KMS\Core\Attributes;

use Komma\KMS\Core\Attributes\Traits\PlaceholderTextTrait;
use Komma\KMS\Core\Attributes\Traits\ReadOnlyTrait;

class Password extends Attribute
{
    use PlaceholderTextTrait;
    use ReadOnlyTrait;

    /**
     * Password constructor.
     * @param string $password The text of the title
     */
    public function __construct(string $password = '')
    {
        parent::__construct();
        $this->setValue($password);
    }

    /**
     * Returns true if the password is an empty string.
     * Notice: When the password is an empty string, the result of getValue is not an empty string!
     * That is why this method is needed.
     */
    public function isEmpty()
    {
        return !$this->value || $this->value == '';
    }

    /**
     * @return string The hashed password.
     */
    public function getValue(): string
    {
        return \Hash::make($this->value);
    }

    /**
     * Returns a view that visually represents this attribute
     *
     * @return \Illuminate\View\View
     */
    public function render()
    {
        return view('KMS::kms/attributes.password', [
            'attribute' => $this
        ]);
    }
}