required()->maxlength(100), self::input('alias', '模型别名')->required()->appendValidates([ self::validateAlphaDash() ]), self::select('table_name', '模型关联表') ->options($this->getCMSTables()) ->style(['width' => '100%']) ->required(), self::textarea('description', '模型描述')->maxlength(255), ]; } /** * 获取 Cms 表 * * @time 2021年04月30日 * @return mixed */ protected function getCMSTables() { $options = self::options(); foreach (Db::getTables() as $table) { if (Str::contains($table, 'cms') && !Str::contains($table, 'relate')) { $options->add($table, $table); } } return $options->render(); } }