'require', 'ip' => 'require|ip', 'type' => 'require|in:1,2', 'status' => 'integer|in:0,1', 'remark' => 'length:0,200', ]; /** * 参数描述 * @var string[] */ protected $field = [ 'id' => 'id', 'ip' => 'IP地址', 'type' => '类型', 'status' => '状态', 'remark' => '备注', ]; /** * @notes 编辑场景 */ public function sceneEdit() { return $this->only(['ip', 'type', 'status', 'remark']); } public function sceneId() { return $this->only(['id']); } public function sceneStatus() { return $this->only(['id', 'field']); } }