fill($attributes); $this->dynamic->set('dynamic', $host); DB::connection('dynamic')->select('SELECT 1 FROM dual'); // The host row and its extension values are written together so a failing // extension cannot leave a host behind without them. return DB::transaction(function () use ($host, $extensions): DatabaseHost { $host->save(); $this->extensions->save($host, $extensions); return $host; }); } }