<?php

/**
 * 文件功能：留言板模型
 *
 * 对应原 ASP 文件：guestbook 表
 *
 * @author   ChatRoom Laravel
 *
 * @version  1.0.0
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Guestbook extends Model
{
    /**
     * The attributes that are mass assignable.
     *
     * @var array<int, string>
     */
    protected $fillable = [
        'who',
        'towho',
        'secret',
        'ip',
        'email',
        'web',
        'addr',
        'post_time',
        'text_title',
        'text_body',
    ];

    /**
     * Get the attributes that should be cast.
     *
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'post_time' => 'datetime',
            'secret' => 'boolean',
        ];
    }
}
