column('id')->sortable(); $grid->column('name'); $grid->column('sex')->using(config('map.sex')); $grid->column('month_old'); $grid->column('join_garden_time'); $grid->column('parent_name'); $grid->column('class_id')->using(config('map.class')); $grid->disableCreateButton(); $grid->actions(function (Grid\Displayers\Actions $actions){ //$actions->append(new Send(Order::class,$actions->row->id)); $actions->append('成长数据'); $actions->append('疫苗接种记录'); $actions->append('考勤登记'); $actions->append('相册'); $actions->append('长牙记录'); }); $grid->filter(function (Grid\Filter $filter) { $filter->panel(); $filter->like('name')->width(4); }); }); } /** * Make a show builder. * * @param mixed $id * * @return Show */ protected function detail($id) { return Show::make($id, new Student(), function (Show $show) { $show->field('id'); $show->field('name'); $show->field('sex'); $show->field('month_old'); $show->field('join_garden_time'); $show->field('parent_name'); $show->field('class_id'); $show->field('name_en'); $show->field('blood_type'); $show->field('hypersensitive_source'); $show->field('past_medical_history'); $show->field('birthday'); $show->field('exclusive_consultant_name'); $show->field('exclusive_consultant_phone'); $show->field('home_address'); $show->field('hobby'); $show->field('family_lang'); $show->field('sleep_habits_and_others'); $show->field('first_communication_of_parents'); $show->field('created_at'); $show->field('updated_at'); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new Student(), function (Form $form) { //$form->display('id'); $form->row(function (Form\Row $row) { $row->width(6)->text('name')->required()->placeholder('请输入中文名'); $row->width(6)->text('name_en')->placeholder('请输入英文名'); }); $form->row(function (Form\Row $row) { $row->width(6)->select('sex')->options(config('map.sex')); $row->width(6)->select('blood_type')->options(config('map.blood_type')); }); $form->row(function (Form\Row $row) { $row->width(12)->text('hypersensitive_source'); }); $form->row(function (Form\Row $row) { $row->textarea('past_medical_history')->required(); }); $form->row(function (Form\Row $row) { $row->width(6)->text('birthday')->required(); $row->width(6)->text('join_garden_time'); }); $form->row(function (Form\Row $row) { $row->width(6)->text('exclusive_consultant_name')->placeholder('请输入专属顾问名'); $row->width(6)->text('exclusive_consultant_phone')->placeholder('请输入专属顾问联系方式'); }); $form->row(function (Form\Row $row) { $row->width(6)->text('parent_name')->placeholder('请输入家长名'); }); $form->row(function (Form\Row $row) { $row->text('home_address'); }); $form->row(function (Form\Row $row) { $row->width(6)->text('hobby')->placeholder('请输入喜好'); $row->width(6)->text('family_lang')->placeholder('请输入家庭语言'); }); $form->row(function (Form\Row $row) { $row->text('sleep_habits_and_others'); }); $form->row(function (Form\Row $row) { $row->textarea('first_communication_of_parents'); }); // $form->text('month_old'); // $form->text('class_id'); }); } }