Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Aliases Laravel Package

craftcms/laravel-aliases

Laravel integration for Craft CMS aliases. Defines common path/URL aliases and resolves them through Laravel’s config/container so you can use Craft-style alias strings in your app, CLI, and packages with consistent environment-aware values.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature Development: Accelerates implementation of dynamic path aliasing for assets, configs, or third-party integrations (e.g., config('aliases.app.logos') resolving to /storage/app/public/logos). Reduces hardcoded paths in codebases, improving maintainability.
    • New: Now explicitly supports Laravel 13, enabling adoption in newer Laravel ecosystems (e.g., projects using Laravel’s latest features like native PHP 8.2+ support or Symfony 7.x components).
  • Roadmap Prioritization: Justifies investing in modular architecture by enabling clean separation of concerns (e.g., vendor-agnostic aliasing for plugins/themes). Aligns with trends toward composable Laravel ecosystems, now with future-proofing for Laravel 13’s evolving stack.
  • Build vs. Buy: Avoids reinventing aliasing logic with minimal maintenance overhead, as the package now includes dependency updates (e.g., ramsey/composer-install v4) to ensure compatibility with modern PHP tooling.
  • Use Cases:
    • Multi-tenant apps: Dynamically resolve tenant-specific paths (e.g., storage/tenant-{id}/uploads).
    • Plugin systems: Let plugins register aliases without polluting global namespace (e.g., vendor.plugin-name::assets).
    • Localization: Serve language-specific assets via aliases (e.g., lang/en/assets).
    • Legacy migration: Gradually replace hardcoded paths in monolithic apps.
    • New: Laravel 13 projects: Ideal for greenfield apps or migrations to Laravel 13, where path resolution must align with the latest framework conventions.

When to Consider This Package

  • Look Here If:
    • Your team frequently deals with path resolution complexity (e.g., assets, configs, or third-party libraries).
    • You’re building a modular Laravel app (plugins, themes, or microservices) where path isolation is critical.
    • You need runtime alias overrides (e.g., for testing or environment-specific configs).
    • Your current aliasing solution is brittle (e.g., relies on manual define() calls or global constants).
    • New: You’re starting a Laravel 13 project or migrating from Laravel 12/11, and need a compatible, lightweight aliasing solution.
  • Look Elsewhere If:
    • Your use case is simple (e.g., static paths in a small app; Laravel’s built-in public_path() suffices).
    • You’re using non-Laravel PHP frameworks (this is Laravel-specific).
    • You need advanced caching or performance optimizations beyond basic alias resolution (consider spatie/laravel-config-array or custom caching layers).
    • Your team lacks PHP/Laravel familiarity to integrate lightweight packages.
    • New: You’re locked into Laravel <12 and cannot upgrade dependencies (e.g., ramsey/composer-install v4 may require PHP 8.1+ or newer Composer versions).

How to Pitch It (Stakeholders)

For Executives: "This package lets us eliminate hardcoded paths in our Laravel app—now fully compatible with Laravel 13—reducing tech debt and making it easier to add plugins or scale features. For example, instead of scattering /storage/app/uploads across 50+ files, we’d use config('aliases.app.uploads'), cutting refactoring time by 30% and future-proofing for multi-tenant or modular designs. It’s a low-risk, high-reward tool to clean up our architecture with minimal dev effort, and the latest update ensures we’re aligned with Laravel’s newest releases."

For Engineering: *"craftcms/laravel-aliases (v2.1.0) wraps Yii’s robust alias system to give us Laravel-native path resolution with zero boilerplate—now officially supporting Laravel 13. Key benefits:

  • Dynamic aliases: Define paths in config/aliases.php or runtime (e.g., Alias::set('app.logos', $tenant->logo_path)).
  • Plugin-friendly: Plugins can register their own namespaces (e.g., plugin.acme::assets) without conflicts.
  • Lightweight: ~50 lines of code, MIT licensed, and maintained, with updated dependencies for modern PHP tooling.
  • New: Laravel 13 ready: Seamlessly integrates with the latest framework features, including PHP 8.2+ optimizations. Use case: If we’re building a plugin system, migrating to Laravel 13, or need tenant-specific paths, this replaces hours of custom logic with a 10-minute setup. Pair it with config:cache for zero runtime overhead."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views