作者 lackoxygen

feat:config

@@ -84,11 +84,16 @@ class Application @@ -84,11 +84,16 @@ class Application
84 */ 84 */
85 protected function configure(string $app = 'default'): Option 85 protected function configure(string $app = 'default'): Option
86 { 86 {
87 - $configure = \config(ServiceProvider::$name . '.' . $app, []); 87 + $configure = \config(ServiceProvider::$name . '.' . $app);
  88 +
  89 + if (is_null($configure)) {
  90 + throw new \InvalidArgumentException('Please publish the configuration file first');
  91 + }
88 92
89 return static::newConfigFormArray($configure); 93 return static::newConfigFormArray($configure);
90 } 94 }
91 95
  96 +
92 /** 97 /**
93 * Load configuration to object Option 98 * Load configuration to object Option
94 * 99 *