public function __construct($attributes = []) { $config = config($this->config); foreach ($config as $key => $val) { if (property_exists(get_called_class(), $key)) { $this->{$key} = $val; } } parent::__construct($attributes); }