<?php

namespace App\Tenancy\Controllers;

use App\Models\DocterOrganization;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
use Encore\Admin\Show;

class DocterVerifyController extends AdminController
{
    /**
     * Title for current resource.
     *
     * @var string
     */
    protected $title = '审核';

    /**
     * Make a grid builder.
     *
     * @return Grid
     */
    protected function grid()
    {
        $grid = new Grid(new DocterOrganization());

        $grid->column('id', __('Id'));
        $grid->column('docter_id', __('Docter id'));
        $grid->column('organization_id', __('Organization id'));
        $grid->column('offices_id', __('Offices id'));
        $grid->column('qualifications_id', __('Qualifications id'));
        $grid->column('state', __('State'));
        $grid->column('created_at', __('Created at'));
        $grid->column('updated_at', __('Updated at'));

        return $grid;
    }

    /**
     * Make a show builder.
     *
     * @param mixed $id
     * @return Show
     */
    protected function detail($id)
    {
        $show = new Show(DocterOrganization::findOrFail($id));

        $show->field('id', __('Id'));
        $show->field('docter_id', __('Docter id'));
        $show->field('organization_id', __('Organization id'));
        $show->field('offices_id', __('Offices id'));
        $show->field('qualifications_id', __('Qualifications id'));
        $show->field('state', __('State'));
        $show->field('created_at', __('Created at'));
        $show->field('updated_at', __('Updated at'));

        return $show;
    }

    /**
     * Make a form builder.
     *
     * @return Form
     */
    protected function form()
    {
        $form = new Form(new DocterOrganization());

        $form->number('docter_id', __('Docter id'));
        $form->number('organization_id', __('Organization id'));
        $form->number('offices_id', __('Offices id'));
        $form->number('qualifications_id', __('Qualifications id'));
        $form->number('state', __('State'));

        return $form;
    }
}
