<?php

namespace Modules\User\Http\Controllers\Admin;

use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
use Modules\User\Models\SignText;

class SignTextController extends AdminController
{
    protected $title = '签到展示文字';

    public function grid(): Grid
    {
        $grid = new Grid(new SignText());

        $grid->column('id', '#ID#');
        $grid->column('title', '标题');
        $grid->column('description', '一级描述');
        $grid->column('sub_description', '二级描述');
        $grid->column('status', '状态')->bool();

        return $grid;
    }

    public function form(): Form
    {
        $form = new Form(new SignText());

        $form->text('title', '标题')->required();
        $form->text('description', '一级描述')->required();
        $form->text('sub_description', '二级描述')->required();
        $form->switch('status', '状态')->default(1);

        return $form;
    }
}