You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
2.6 KiB
98 lines
2.6 KiB
<?php
|
|
|
|
namespace App\Admin\Controllers;
|
|
|
|
use App\Admin\Repositories\Equip;
|
|
use Dcat\Admin\Form;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Show;
|
|
use Dcat\Admin\Http\Controllers\AdminController;
|
|
|
|
class EquipController extends AdminController
|
|
{
|
|
/**
|
|
* Make a grid builder.
|
|
*
|
|
* @return Grid
|
|
*/
|
|
protected function grid()
|
|
{
|
|
return Grid::make(new Equip(), function (Grid $grid) {
|
|
$grid->column('id')->sortable();
|
|
$grid->column('title');
|
|
$grid->column('desc');
|
|
$grid->column('tags');
|
|
$grid->column('protocol');
|
|
$grid->column('location');
|
|
$grid->column('private');
|
|
$grid->column('auth_info');
|
|
$grid->column('auth');
|
|
$grid->column('obsv');
|
|
$grid->column('other');
|
|
$grid->column('chip');
|
|
$grid->column('psk');
|
|
$grid->column('created_at');
|
|
$grid->column('updated_at')->sortable();
|
|
|
|
$grid->filter(function (Grid\Filter $filter) {
|
|
$filter->equal('id');
|
|
|
|
});
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Make a show builder.
|
|
*
|
|
* @param mixed $id
|
|
*
|
|
* @return Show
|
|
*/
|
|
protected function detail($id)
|
|
{
|
|
return Show::make($id, new Equip(), function (Show $show) {
|
|
$show->field('id');
|
|
$show->field('title');
|
|
$show->field('desc');
|
|
$show->field('tags');
|
|
$show->field('protocol');
|
|
$show->field('location');
|
|
$show->field('private');
|
|
$show->field('auth_info');
|
|
$show->field('auth');
|
|
$show->field('obsv');
|
|
$show->field('other');
|
|
$show->field('chip');
|
|
$show->field('psk');
|
|
$show->field('created_at');
|
|
$show->field('updated_at');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Make a form builder.
|
|
*
|
|
* @return Form
|
|
*/
|
|
protected function form()
|
|
{
|
|
return Form::make(new Equip(), function (Form $form) {
|
|
$form->display('id');
|
|
$form->text('title');
|
|
$form->text('desc');
|
|
$form->text('tags');
|
|
$form->text('protocol');
|
|
$form->text('location');
|
|
$form->text('private');
|
|
$form->text('auth_info');
|
|
$form->text('auth');
|
|
$form->text('obsv');
|
|
$form->text('other');
|
|
$form->text('chip');
|
|
$form->text('psk');
|
|
|
|
$form->display('created_at');
|
|
$form->display('updated_at');
|
|
});
|
|
}
|
|
}
|
|
|