<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * App\Models\Account
 *
 * @property int $id
 * @property string $user_name 用户名
 * @property string $account 账号
 * @property string $password 密码
 * @property int $type 用户类型 1-普通用户 2-VIP 3-设计师
 * @property string|null $remark 备注
 * @property int $status 状态 1-正常 0-禁用
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|Account newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Account newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Account query()
 * @method static \Illuminate\Database\Eloquent\Builder|Account whereAccount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Account whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Account whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Account wherePassword($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Account whereRemark($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Account whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Account whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Account whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Account whereUserName($value)
 * @mixin \Eloquent
 * @property-read \App\Models\User|null $user
 */
class Account extends Model
{
	use HasDateTimeFormatter;

    protected $table = 'accounts';

    protected $hidden = [
        'password','updated_at'
    ];

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class,'id','account_id');
    }
}
