<?php

namespace App\Admin\Controllers\Link;

use App\Models\Link;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;

class IndexController extends AdminController
{

    protected $title = '友情链接';

    public function grid()
    {
        $grid = new Grid(new Link);

        $grid->column('id', '#ID#');
        $grid->column('title', '标题');
        $grid->column('url', '地址');
        $grid->column('created_at', '创建时间');

        return $grid;
    }

    public function form()
    {
        $form = new Form(new Link);

        $form->text('title', '标题')->required();
        $form->text('url', '地址')->required();

        return $form;
    }

}
