setName('task')->setDescription('Compress js and css file'); } protected function execute(Input $input, Output $output) { $reg = new Region(); $list = collection($reg::where('level', '=', 1)->select())->toArray(); $arr = array(); foreach ($list as $key => $value) { $arr[$value['id']] = $reg->where('parent_id', '=', $value['id'])->column('id,name'); } file_put_contents('./11.txt', json_encode($arr, JSON_UNESCAPED_UNICODE)); $output->info("Ok Successed!"); } }