model()->orderBy('updated_at','desc'); $grid->id->sortable(); $grid->column('device_name','设备编号'); $grid->column('store_id','商户ID'); $grid->column('store.name','商户名'); $grid->column('is_bind') ->using([0=>'未绑定',1=>'已绑定']) ->label([0=>'danger',1=>'success']); $grid->created_at; $grid->updated_at->sortable(); $grid->filter(function (Grid\Filter $filter) { $filter->equal('id'); $filter->equal('store_id'); }); }); } /** * Make a show builder. * * @param mixed $id * * @return Show */ protected function detail($id) { return Show::make($id, new LanzuServiceSpeaker(), function (Show $show) { $show->id; $show->created_at; $show->updated_at; }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new LanzuServiceSpeaker(), function (Form $form) { $form->display('id'); $form->text("device_name",'设备编号')->required(); $form->number("store_id",'商户ID')->required(); $form->switch('is_bind', '是否绑定'); //$form->image("device_name")->disk('oss'); $form->display('created_at'); $form->display('updated_at'); }); } }