<?php

namespace AuthStack\UserDirectory\Model;

use Illuminate\Database\Eloquent\Model;

class Organization extends Model
{
    protected $table = 'organizations';

    public $timestamps = true;

    /**
     * Is password history enabled?
     *
     * @return bool
     */
    public function historyEnabled(): bool
    {
        return !empty($this->history);
    }

    /**
     * Is minimum password length specified?
     * @return bool
     */
    public function hasMinPasswordLength(): bool
    {
        return !empty($this->min_length);
    }

    /**
     * Minimum password length
     * @return int
     */
    public function minPasswordLength(): int
    {
        return (int)$this->min_length;
    }


}