Skip to content

Fix #42: declare the laravel/framework dependency the package already has - #88

Open
corgab wants to merge 2 commits into
mainfrom
fix/42-declare-framework-dependency
Open

Fix #42: declare the laravel/framework dependency the package already has#88
corgab wants to merge 2 commits into
mainfrom
fix/42-declare-framework-dependency

Conversation

@corgab

@corgab corgab commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

composer.json required only illuminate/console, contracts, database and support, yet src/ imports Illuminate\Foundation\Console\AboutCommand, Illuminate\Foundation\Bus\PendingDispatch and Illuminate\Foundation\Queue\Queueable, and calls the config(), app(), event(), report(), dispatch(), base_path() and config_path() helpers. Those all live in laravel/framework's Illuminate\Foundation, so the manifest did not describe what the package needs.

Plan

The issue suggested adding illuminate/foundation, queue, bus, cache and events. illuminate/foundation does not exist: laravel/framework's replace list covers every split component except Foundation, which is only shipped inside the framework itself. Since the package genuinely depends on Foundation classes and helpers, the accurate declaration is laravel/framework: ^13.0. That single entry also provides every illuminate/* component, so the four previous entries are dropped rather than kept as duplicates, and the CI matrix pins the framework itself.

Changes

  • composer.json: require is now php, laravel/framework: ^13.0, symfony/process.
  • .github/workflows/tests.yml: the matrix step pins laravel/framework:${{ matrix.laravel }} instead of the four components, so the version under test is the one actually installed and a future 14.* row cannot conflict with a ^13.0 framework pin.
  • tests/Unit/ComposerManifestTest.php (new): asserts laravel/framework is required (no coupling to the constraint string), and that src/ still uses Illuminate\Foundation classes or the Foundation helpers, which is what justifies the requirement. The first test fails on main.
  • CLAUDE.md: one conventions bullet.

No behaviour change, no new runtime code. composer.lock is not tracked by the repository.

Tests

Local: pint passed, pest 793 tests passed, composer validate passes on the manifest.

Closes #42

src/ imports Illuminate\Foundation (AboutCommand, PendingDispatch,
Foundation\Queue\Queueable) and calls the config(), app(), event(),
report() and dispatch() helpers, all of which ship only inside
laravel/framework: Foundation is not published as a standalone
illuminate/* component, so the illuminate/* entries alone did not
describe what the package needs. composer.json now requires
laravel/framework ^13.0 alongside them, and a manifest test fails if an
Illuminate namespace is imported without a package that provides it.

Closes #42
With laravel/framework required, the four illuminate/* entries only
duplicated what the framework already replaces, and the CI matrix pinned
those components instead of the framework that actually gets installed;
the matrix now pins laravel/framework per Laravel version. The manifest
test asserts the requirement itself, not its version constraint, and
checks that src still uses Illuminate\Foundation classes or helpers, which
is what justifies it.
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.

[composer] composer.json omits illuminate/foundation (and related) despite using its classes and helpers directly

1 participant