$defaults The default config items. */ public function __construct( array $defaults ) { $this->defaults = $defaults; } /** * Get the value of a default config item. * * @param string|null $key The config key, if no key we'll return all items. * * @return mixed|T */ public function get( ?string $key = null ) { if ( is_null( $key ) ) { return $this->defaults; } return Arr::get( $this->defaults, explode( '.', $key ) ); } }