'if_exist|min_length[10]|max_length[200]', 'account_uid' => 'if_exist|min_length[10]|max_length[200]', 'domain' => 'if_exist|string', 'name_servers' => 'if_exist|string', 'plan' => 'if_exist|string', 'development_mode' => 'if_exist|in_list[on,off]', 'ipv6' => 'if_exist|in_list[on,off]', 'security_level' => 'if_exist|string', 'status' => 'if_exist|string', 'updated_at' => 'if_exist|valid_date', 'created_at' => 'if_exist|valid_date', ]; // 'security_level' => 'if_exist|in_list[essentially_off,low,medium,under_attack]', // 'status' => 'if_exist|in_list[active,pending]', protected $validationMessages = []; protected $skipValidation = false; protected $cleanValidationRules = true; // Callbacks protected $allowCallbacks = true; protected $beforeInsert = []; protected $afterInsert = []; protected $beforeUpdate = []; protected $afterUpdate = []; protected $beforeFind = []; protected $afterFind = []; protected $beforeDelete = []; protected $afterDelete = []; public function getTableName() { return $this->table; } public function getEntity(string $uid): null|AllowListEntity { $entity = $this->asObject(AllowListEntity::class)->first($uid); if (is_null($entity)) { throw new \Exception("해당 정보가 없습니다."); } return $entity; } public function getFilterFields(string $type = '', array $fields = array()) { $filterFields = ['account_uid', 'development_mode', 'ipv6', 'security_level', 'status']; switch ($type) { case 'only': return array_diff_assoc($filterFields, $fields); break; case 'except': return array_diff_uassoc($filterFields, $fields); break; default: return $filterFields; break; } } public function setIndexWordFilter(string $word) { $this->like('domain', $word, 'both'); //befor , after , both } public function setIndexDateFilter($start, $end) { $this->where('created_at >=', $start); $this->where('created_at <=', $end); } }