first(); if (!$destination) { throw new Exception('Destination not found'); } return StandalonePostgresql::create([ 'name' => generate_database_name('postgresql'), 'postgres_password' => \Illuminate\Support\Str::password(), 'environment_id' => $environment_id, 'destination_id' => $destination->id, 'destination_type' => $destination->getMorphClass(), ]); }