id); $model->name = $input['name']; //$model->company_name = $input['company_name']; //$model->address = $input['address']; $model->director = $input['director']; $model->contact_phone = $input['contact_phone']; $model->avatar = $input['avatar']; $model->license = $input['license']; //$model->business_license = $input['business_license']; $model->status = UserStatus::UNAUDITED; $model->save(); return $this->response()->success('保存成功')->refresh(); } /** * Build a form here. */ public function form() { Admin::translation('supplier'); $this->display('company_name'); $this->display('province.name','省份'); $this->display('city.name','城市'); $this->display('area.name','地区'); $this->display('address'); $this->display('credit_codes'); $this->display('corporate_account'); $this->display('deposit_bank'); $this->text('name')->required(); $this->text('director')->required(); $this->text('contact_phone')->required(); $this->image('avatar'); $this->image('license')->required()->disable(); $this->image('business_license')->required()->disable(); $this->confirm('编辑确认', '编辑内容需要管理员重新审核,确定要提交吗?'); } /** * The data of the form. * * @return array */ public function default() { return Supplier::with(['province','city','area'])->find(Admin::user()->id)->toArray(); } }