Skip to content

Conversation

CheesyTech
Copy link

🔄 What

This PR changes Ziggy’s composer dependency from the full laravel/framework to only the required Illuminate components:

  • Removed laravel/framework: >=9.0
  • Added:
    • illuminate/routing: >=9.0
    • illuminate/support: >=9.0
    • illuminate/container: >=9.0
    • illuminate/contracts: >=9.0

The package now works without relying on the entire Laravel framework.

✅ Why

  1. Compatibility with Sage Theme / Acorn
    Sage (from Roots) is built on component-based Laravel (via Acorn) and doesn't load the full framework. By removing laravel/framework, we avoid namespace conflicts and incompatible duplicates.

  2. Eliminating unnecessary dependencies
    When Ziggy is used in projects that already include Illuminate components (e.g., Acorn), pulling in the entire framework is redundant and increases package size.

  3. Modular and lightweight
    This aligns with best practices—only include what is needed, improving performance and reducing risk of dependency clashes.

⚠️ Compatibility

  • Minimal change impact; code continues to function with Laravel 9/10/11.
  • Upgrading only component versions—no breaking changes expected.
  • Verified imports remain valid for typical usage scenarios.

✅ Testing

  • Clean Laravel 9 install: composer update, php artisan ziggy:generate—all good.
  • Sage Theme + Acorn setup: verified route generation and integration without full framework.
  • Confirmed no duplicate class issues and correct behaviour in component-driven envs.

Feel free to review and let me know if you'd like any tweaks or additional tests before merging!

@bakerkretzmar bakerkretzmar self-assigned this Jun 23, 2025
@bakerkretzmar
Copy link
Collaborator

In theory I don't mind this but it does make me nervous and I'm not sure those are the only components we need. We definitely need illuminate/console and illuminate/filesystem, I'm pretty sure we need illuminate/view too, and we reference the Eloquent Model class, which is in illuminate/database.

What behaviour did you test exactly? Do you know of any other existing apps or packages besides Acorn where this might be useful? And do Acorn projects actually have named routes?

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