'required', 'name' => 'required', 'module' => 'required', 'displayorder' => 'numeric|min:0|max:254', 'status' => 'numeric', 'containtype' => 'required', 'reply_type' => 'numeric|min:0', ]; } public function atributeNames() { return [ 'uniacid' => '公众号ID', 'name' => '规则', 'module' => '模块', 'displayorder' => '回复优先级', 'status' => '状态', 'containtype' => '回复内容类型', 'reply_type' => '回复类型', ]; } public function hasManyKeywords() { return $this->hasMany(RuleKeyword::class,'rid','id'); } public static function getRuleByName($name) { return self::uniacid()->where('name', $name)->first(); } }