Conversation
Wave 0 of the 53-package Laravel 11 -> 13 upgrade campaign. Updates
df-core to compose, autoload, and runtime-load cleanly under Laravel
13.7 while preserving the package's framework-agnostic require list and
its public API for downstream consumers (df-system, df-user, df-aws,
and ~50 other packages).
Composer:
- Bump php to ^8.3 (matches Laravel 13 minimum + main app PR #578).
- Drop unused doctrine/dbal (zero src/ usage).
- Add laravel/helpers ^1.8 (production polyfill for the 346 sites of
array_get/camel_case/array_except still in df-core).
- Widen symfony/yaml to ^6.0|^7.0.
- Add Laravel 13 dev-stack: laravel/framework ^13.7 (require-dev to
keep df-core framework-agnostic), phpunit/phpunit ^11.5.3,
mockery/mockery ^1.6, nunomaduro/collision ^8.6, orchestra/testbench
^11.0 (^11 is the L13-compatible track; ^10 pins L12).
Source:
- Http/Controllers/Controller: drop DispatchesJobs trait (removed in
Laravel 11). Verified zero $this->dispatch() callers in df-core.
- LaravelServiceProvider: replace include __DIR__/../routes/routes.php
with $this->loadRoutesFrom() (idiomatic + handles route-cache
internally); gate Route::prependMiddlewareToGroup('web', ...) with
Route::hasMiddlewareGroup('web') (L13's API-only stack may not
register the web group); gate MongoDB and CORS provider
registrations with class_exists() so missing-package degrades
gracefully.
- Providers/CorsServiceProvider: drop unused Kernel $kernel parameter
from boot() (and its `use Illuminate\Contracts\Http\Kernel;`).
Confirmed Laravel 13.7's HandleCors middleware still typehints
Fruitcake\Cors\CorsService, so the singleton binding remains
correct; CorsService class is unchanged.
- Models/NoDbModel: keep getDates()/getDateFormat() overrides but
harden them. The HasAttributes trait calls $this->getDates()
during attributesToArray()->addDateAttributesToArray(), and the
trait's own implementation depends on usesTimestamps() which
NoDbModel cannot satisfy (it doesn't extend Model and doesn't use
HasTimestamps). Without the override the call chain reaches
usesTimestamps() and fatal-errors. Stub implementations now defend
against $dates / $dateFormat being unset.
- Database/Connectors/SQLiteConnector: add `: \PDO` covariant return
type to connect() (parent has no return type; widening allowed).
- Testing/TestCase: rename setupBeforeClass -> setUpBeforeClass
(PHPUnit 11 is case-sensitive). Replace the broken cwd-relative
require './bootstrap/app.php' with a path resolver that walks up
from this file looking for bootstrap/app.php + artisan, and
supports DF_TEST_BOOTSTRAP env override.
- helpers.php: replace internal array_get() calls inside df-core's
own helper functions with Illuminate\Support\Arr::get() so the
package's helpers do not require the laravel/helpers polyfill at
runtime. The 346 helper sites elsewhere in df-core stay polyfilled
(out of scope for this PR).
Verified:
- composer validate --strict: passes.
- composer install (with path-repo aliases for the structural
df-system <-> df-core circular require): resolves Laravel 13.7.0,
PHPUnit 11.5.55, testbench v11.1.0.
- php -l on every src/ + tests/ file: zero parse errors.
- Smoke test: 10/10 critical df-core classes (Controller, BaseModel,
NoDbModel, BaseSystemLookup, Builder, DfCorsService,
SQLiteConnector, CorsServiceProvider, LaravelServiceProvider,
TestCase) load via reflection; NoDbModel and BaseModel toArray()
runs without fatal.
This was referenced May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave 0 of the 53-package Laravel 11 → 13 upgrade campaign. This PR
makes
df-corecompose, autoload, and runtime-load cleanly underLaravel 13.7 while keeping the package framework-agnostic in its
production
require(host application pins the framework version).Tracks main-app L13 Shift PR dreamfactory/dreamfactory#578.
Companion to df-commercial gold release 7.4.5.
Changes (8 files)
composer.jsonphp^8.0^8.3doctrine/dbal^3.1.4src/usagesymfony/yaml^6.0^6.0|^7.0laravel/helpers^1.8(require)array_get/camel_case/array_exceptsites still in df-core; production-required so consumers don't need to add itlaravel/framework^13.7(require-dev)requirephpunit/phpunit@stable^11.5.3mockery/mockery^1.6nunomaduro/collision^8.6orchestra/testbench^11.0^10pins to Laravel 12;^11is the L13-compat tracksrc/Http/Controllers/Controller.phpRemoved
DispatchesJobstrait. The trait was removed from Laravel core in Laravel 11 (upgrade guide). Verified zero$this->dispatch()callers anywhere in df-core. Sibling-packagedf-scriptuses the trait directly — that's its own future fix, not blocked by this change.src/LaravelServiceProvider.phpThree changes:
include __DIR__.'/../routes/routes.php'with$this->loadRoutesFrom()— handles route-cache check internally, idiomatic for L11+.Route::prependMiddlewareToGroup('web', FirstUserCheck::class)withRoute::hasMiddlewareGroup('web'). L13's API-only application stack does not register awebgroup; the un-gated call would throwInvalidArgumentException.MongoDBServiceProviderandCorsServiceProviderregistrations withclass_exists()for graceful degradation when the optional package isn't installed.src/Providers/CorsServiceProvider.phpDropped the unused
Kernel $kernelparameter fromboot()(and itsuse Illuminate\Contracts\Http\Kernel;).Important verification: Laravel 13.7's
Illuminate\Http\Middleware\HandleCorsstill typehintsFruitcake\Cors\CorsServicein its constructor (Laravel did NOT migrate to a first-partyIlluminate\Http\CorsService— seevendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php). The existingsingleton(Fruitcake\Cors\CorsService::class, ...)binding is therefore correct and unchanged. Same forDfCorsService extends Fruitcake\Cors\CorsService.src/Models/NoDbModel.phpHardened the
getDates()/getDateFormat()overrides instead of removing them. Removing them broke runtime — verified by smoke test that without the override,attributesToArray()→addDateAttributesToArray()→getDates()(trait fallback) →usesTimestamps()→ fatalCall to undefined method, becauseNoDbModeldoesn't extendModeland doesn't useHasTimestamps. The new stubs short-circuit safely whether$dates/$dateFormatare set on the subclass or not.src/Database/Connectors/SQLiteConnector.phpAdded
: \PDOcovariant return type toconnect(). Parent has no return type; widening is allowed.src/Testing/TestCase.phpsetupBeforeClass→setUpBeforeClass(PHPUnit 11 is case-sensitive; PHPUnit 9 also was, so this was a latent bug).require './bootstrap/app.php'(relative to the runner's cwd, never reliable) with aresolveBootstrapPath()helper that:DF_TEST_BOOTSTRAPenv override.bootstrap/app.phpif present.bootstrap/app.phpandartisan.src/helpers.phpReplaced the four internal
array_get()calls inside df-core's own helpers withIlluminate\Support\Arr::get(). df-core's helpers no longer depend on thelaravel/helperspolyfill being installed at runtime. (The 346array_getsites elsewhere in models/services/components stay polyfilled — out of scope for this PR; follow-up will migrate them toArr::/Str::.)Test plan
Stage 1 — package-isolated
composer validate --strict: passescomposer install(with path-repo aliases for the pre-existing structuraldf-system ↔ df-corecircularrequire— this is not new in L13): resolveslaravel/framework v13.7.0,phpunit/phpunit 11.5.55,orchestra/testbench v11.1.0,tymon/jwt-auth 2.3.0,symfony/yaml v7.4.8php -lacross allsrc/+tests/files: zero parse errorsNoDbModel::toArray()andBaseModel::toArray()run without fatal;DfCorsService::__construct()worksStage 2 — integration with Shift'd main app (
shift-173254)shift-173254+ path-repo override pointing at this branchcomposer update dreamfactory/df-core: succeedsphp artisan test— NOT RUN: blocked by sibling packages (df-file,df-aws,df-mongo-logs, etc.) not yet upgraded.df-mongo-logsrequiresjenssegers/mongodbwhich pinsilluminate/support ^10.0|^11, blocking L13 resolution. Tolerated per Wave 0 plan; sibling upgrades are Wave 1+.Stage 3 — review
Self-review against the diff caught one critical spec error before commit (the spec said "remove
getDates()from NoDbModel — dead code"; runtime smoke test proved it's load-bearing for the trait composition). Restored with hardening.Reviewer notes / key risks
NoDbModel::getDates()is load-bearing. Do not remove. The HasAttributes trait calls it duringattributesToArray(), and NoDbModel can't satisfy the trait's default implementation because it doesn't extend Model. This was the spec's most important false-positive.Fruitcake\Cors\CorsService. There is noIlluminate\Http\CorsServicein L13.7. Verified directly againstvendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php.orchestra/testbenchconstraint: must be^11.0, not^10.0. v10 pins L12.df-corerequiresdf-system ~0.6.2, anddf-systemrequiresdf-core ~1.0. df-core'sdev-masterdoesn't satisfy~1.0, so standalonecomposer installhas never worked on master and still doesn't. Not introduced by this PR. Stage 1 used path-repo aliases as a workaround.df-scriptusesDispatchesJobsdirectly (not via df-core'sController). It will need its own L13 fix (the trait was removed in L11). Out of scope for this PR; flagged for Wave 1+.Generalizable insights for sibling-package waves
vendor/laravel/framework/.../HandleCors.phpfor the actual constructor typehint.$this->method()internally. If a child class uses the trait directly (not viaModel), removing the override can blow up the trait chain. Always smoke-testtoArray()/jsonSerialize().orchestra/testbenchmajor-version tracks Laravel: v10 → L12, v11 → L13. Don't carry over the spec's^10.webmiddleware group is API-only-stack-optional in L13. Always gateprependMiddlewareToGroup('web', ...).DispatchesJobswas removed in L11, not L13. Sibling packages with directuse Illuminate\Foundation\Bus\DispatchesJobs;will fatal at autoload time once they're upgraded.PHPUnit 11is case-sensitive onsetUpBeforeClass. Audit allsetupBeforeClasstypos in sibling packages — this was latent on master.