Skip to content

fix database API compatibility - #205

Open
jewei wants to merge 2 commits into
laravel:mainfrom
jewei:fix/database-cluster-list-include
Open

fix database API compatibility#205
jewei wants to merge 2 commits into
laravel:mainfrom
jewei:fix/database-cluster-list-include

Conversation

@jewei

@jewei jewei commented Aug 21, 2026

Copy link
Copy Markdown

The CLI still used the deprecated schemas relationship for database cluster requests. Laravel Cloud rejects these requests because the accepted include is databases.

The database restore request also used the obsolete plural /restores endpoint. This route returned the Laravel Cloud HTML page with HTTP 200 instead of an API response. The current API uses the singular /restore endpoint.

This change:

  • uses include=databases for all database cluster requests
  • uses the current singular database restore endpoint
  • adds feature tests for cluster list, cluster delete, and restore creation
  • covers restore creation with a cluster ID and with automatic cluster resolution

A live point-in-time restore completed the request successfully and returned a new cluster with restoring status.

API reference: https://laravel.com/cloud/docs/api/database-restores/create-a-database-restore

Tests

  • vendor/bin/pest tests/Feature/DatabaseClusterDeleteTest.php tests/Feature/DatabaseClusterListTest.php tests/Feature/DatabaseRestoreCreateTest.php
  • vendor/bin/pint --test
  • vendor/bin/phpstan analyse --no-progress

jewei added 2 commits August 21, 2026 10:33
Cloud rejects deprecated include=schemas requests and serves HTML for the obsolete plural restore endpoint.
@jewei jewei changed the title use databases include when listing database clusters fix database API compatibility Aug 21, 2026
@michaelfromtheoutfit

Copy link
Copy Markdown

Confirming this reproduces on a clean v0.5.2 install (macOS, composer global require laravel/cloud-cli). Every database command fails before doing anything useful:

$ cloud database-cluster:list --json -n
Bad Request (400) Response: {
    "message": "Requested include(s) `schemas` are not allowed. Allowed include(s) are `databases`."
}

Same 400 from database-cluster:get <cluster> and database-snapshot:list <cluster> (the resolver hits the cluster endpoint with the same include).

We depend on database-cluster:list/get/update/delete, database-snapshot:list/create, and database-restore:create for a scripted snapshot → temp-cluster → dump → destroy workflow, and this blocks all of it. For what it's worth, #187 in v0.5.1 fixed the Form::$errors fatal in database-restore:create (#183), but that fatal fired before the HTTP call, so the obsolete /restores endpoint described here was hidden behind it. Would be great to see this merged and released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants