id->sortable(); $grid->name; $grid->tel; $grid->market_id('所属市场')->display(function (){ return ImsCjdcMarket::find($this->market_id)->name; }); $grid->status('状态')->using([1=>'正常',-1=>'禁用']); $grid->head_url->image('',50,50); $grid->created_at->display(function ($time){ return date('Y-m-d H:i',$time); }); $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 LanzuServiceHorseman(), function (Show $show) { $show->id; $show->user_id('懒ID'); $show->name; $show->tel; $show->market_id('所属市场')->as(function (){ return ImsCjdcMarket::find($this->market_id)->name; }); $show->status('状态')->using([1=>'正常',-1=>'禁用']); $show->head_url->image(); $show->created_at->as(function ($time){ return date('Y-m-d H:i',$time); }); $show->updated_at->as(function ($time){ return date('Y-m-d H:i',$time); }); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new LanzuServiceHorseman(), function (Form $form) { $form->display('id'); $form->text('user_id','懒ID')->required(); $form->text('name')->required(); $form->mobile('tel')->required(); $form->select('market_id','所属市场')->options(ImsCjdcMarket::getMarket())->required(); $form->radio('status','状态')->options([1=>'启用',-1=>'禁用'])->value(1)->required(); $form->image('head_url')->uniqueName()->required(); $form->display('created_at'); $form->display('updated_at'); }); } }