Skip to content

Laravel 13 compatibility#51

Draft
thekevinm wants to merge 1 commit intomasterfrom
shift/laravel-13
Draft

Laravel 13 compatibility#51
thekevinm wants to merge 1 commit intomasterfrom
shift/laravel-13

Conversation

@thekevinm
Copy link
Copy Markdown
Contributor

Summary

Wave 4 of the Laravel 11 → 13 upgrade campaign for the DreamFactory platform. Brings df-aws to Laravel 13.7 / PHP 8.3 / PHPUnit 11.

composer.json

  • php^8.3
  • new laravel/helpers ^1.8 (production require — polyfills array_get/array_except/camel_case consumed throughout the package and its peers)
  • new explicit dreamfactory/df-core ~1.0.4 (was implicitly transitive through df-database; pin makes the L13-compatible base explicit)
  • dreamfactory/df-database widened from ~1.4.0 to ~1.4 (continues to pull 1.4.x with the shift/laravel-13 fixes)
  • aws/aws-sdk-php pinned to ^3.330 (resolves to 3.380.0 today)
  • new require-dev block with laravel/framework ^13.7, phpunit/phpunit ^11.5.3, orchestra/testbench ^11.0, mockery/mockery ^1.6, nunomaduro/collision ^8.6

src/Database/RedshiftConnection.php

  • Drop getDoctrineDriver() overrideIlluminate\Database\Connection::getDoctrineDriver() was removed in Laravel 13 (Doctrine DBAL is no longer a Framework dep). The override and its Doctrine\DBAL\Driver\PDOPgSql\Driver import are gone.
  • Replace withTablePrefix(new QueryGrammar) / withTablePrefix(new SchemaGrammar) with new QueryGrammar($this) / new SchemaGrammar($this) — Laravel 13's Illuminate\Database\Grammar::__construct(Connection $connection) is mandatory and Connection::withTablePrefix($grammar) was deleted. The new form passes the owning connection so Grammar can read the prefix off $this->connection->getTablePrefix().

src/Database/Schema/RedshiftBuilder.php

  • Drop hasTable($table) override. Two reasons: (1) it called $this->grammar->compileTableExists() with zero arguments, which would fatal under L13 — Schema\Grammars\PostgresGrammar::compileTableExists now requires ($schema, $table). (2) The parent's L13 implementation already does what the override intended (parses schema-and-table, applies the connection's table prefix, calls the grammar with the right arity, returns bool), so the override is redundant. A docblock on the now-empty subclass explains why so it isn't reintroduced.

The S3 / SES / SNS / SQS / DynamoDB services are AWS-SDK-driven and framework-independent — no source changes needed there. SES still wraps Illuminate\Mail\Transport\SesTransport, which exists and works in L13 (Symfony AbstractTransport-based).

Verification

Stage 1 — isolated install (containerised, path-repo siblings):

  • composer validate --strict: clean (one harmless "version field present" warning from the Stage-1 overlay)
  • composer install --no-dev: resolves cleanly; all six df-* siblings symlinked from shift/laravel-13 branches; aws/aws-sdk-php 3.380.0 installed
  • Custom Stage-1 smoke harness: 34/34 OK, 0 errors
    • 25/25 public classes load via class_exists()
    • 3/3 helper polyfills (array_get, array_except, camel_case) registered
    • Reflective construction of RedshiftConnection: useDefaultQueryGrammar() / useDefaultSchemaGrammar() / useDefaultPostProcessor() all bind the right concrete classes, getSchemaBuilder() returns RedshiftBuilder, compileTableExists($schema, $table) 2-arg signature confirmed, getDoctrineDriver() confirmed removed from class graph

Stage 2 — host-app shift-173254 worktree:

  • Standard Wave 4 strip-list applied (drop df-mongo-logs, df-git, df-mcp-server, df-oauth + their VCS repo entries; comment MongoDB\Laravel\MongoDBServiceProvider in config/app.php)
  • Path-repos for df-core, df-system, df-user, df-database, df-sqldb, df-email, df-file, df-aws (all at their shift/laravel-13 branches)
  • composer install --no-dev: resolves cleanly; df-aws 0.20.99 symlinked
  • php artisan package:discover --ansi: DONE for dreamfactory/df-aws and all 24 sibling providers
  • Stage-2 smoke harness: 26/26 OK, 0 failures (autoload + reflective construction of RedshiftConnection inside the host vendor graph)

Test plan

  • CI install on Laravel 13.7
  • Wire a real Redshift instance and exercise Schema::hasTable(), INSERT ... RETURNING (Redshift-specific compileInsertGetId), and compileTableExists($schema, $table) to confirm runtime behaviour matches Stage smoke
  • Smoke S3 file service, SES mail transport, SNS publish, DynamoDB CRUD on the L13 host
  • Run host-app php artisan test once the remaining Wave 4/5 siblings (df-cassandra, df-firebird, df-azure, df-mqtt, df-rws, etc.) land their L13 PRs

* composer.json — bump to Laravel 13.7 / PHP 8.3 / PHPUnit 11.5.3 /
  testbench 11.0; widen df-database to ~1.4; pin aws-sdk-php ^3.330;
  add laravel/helpers ^1.8 polyfills; pull df-core ~1.0.4 directly so
  consumers get the L13-compatible base.
* RedshiftConnection — drop the stale getDoctrineDriver() override
  (Connection::getDoctrineDriver was removed in L13) and replace the
  L11 withTablePrefix(new Grammar) calls with the L13-required
  Grammar(Connection $c) constructor form. Removes the Doctrine\DBAL
  import.
* RedshiftBuilder — drop the legacy hasTable() override. The parent's
  implementation calls Grammar::compileTableExists($schema, $table)
  with the L13 two-argument signature and already honours the
  connection's configured schema and table prefix; the override was
  passing zero arguments and would fatal at runtime under L13.

Stage 1 isolated install passes (composer install --no-dev resolves,
class_exists OK across all 25 public classes, helper polyfills
register, RedshiftConnection reflectively constructs and binds the
Redshift query/schema grammars + processor + builder cleanly).
Stage 2 host-app shift-173254 install passes with package:discover
green for df-aws.
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.

1 participant