owenvoke/laravel-xdg
A Laravel package for working with the XDG Base Directory specification, helping resolve standard config, data, cache, and state directories across platforms. It provides convenient helpers for using XDG paths within Laravel applications.
Architecture fit: owenvoke/laravel-xdg is a narrow, single-purpose package that maps Laravel's storage-related paths (config, cache, data, state) onto the XDG Base Directory specification (XDG_CONFIG_HOME, XDG_CACHE_HOME, XDG_DATA_HOME, XDG_STATE_HOME). Architecturally it is a thin service-provider layer over path resolution — it does not touch the HTTP kernel, Eloquent, queue internals, or the container's core bindings. That makes it a low-coupling addition: it either fits as an opt-in path policy for Linux/desktop/CLI-oriented deployments, or it is irrelevant. It is not a fit for conventional containerized server deployments where paths are already controlled via storage_path() overrides, bind mounts, or environment variables, and adopting it there would add indirection without benefit.
Integration feasibility: High. Standard Composer install with Laravel package auto-discovery; no published config file is strictly required for default behavior. Realistic effort is well under a day for a proof-of-concept and 1–3 days including validation and documentation.
Technical risk: Low-to-moderate, and dominated by project risk rather than code risk:
@matt-h contributed this release, @owenvoke owns the package). Small community package with modest download volume — treat as a dependency you may need to fork.$HOME/.config, $HOME/.local/share, etc.), must be verified explicitly.Key questions:
storage_path, config_path, cache_path, or only expose new helpers/paths that application code opts into?$HOME may be unset?php artisan config:cache, route:cache, and optimize?APP_STORAGE_PATH-style overrides or custom storage_path() bindings already in the codebase?Release-specific note (v1.5.0): This is a compatibility-only release adding Laravel 12 support. No breaking changes, no deprecations, no new runtime behavior. Its value is unblocking — it removes a Composer constraint conflict for teams upgrading to Laravel 12. Low urgency for anyone not on Laravel 12; near-mandatory sequencing item for anyone who is.
Stack fit: Laravel 10/11/12 with PHP 8.1+ (verify the exact floor in composer.json before committing). The package is only meaningful for deployments where XDG semantics are actually desired — Linux workstations, CLI tooling, developer environments, or portable/self-contained installs. For standard Docker/Kubernetes services writing to /var/www/html/storage, it is a net-negative abstraction.
Migration path:
config_path(), storage_path(), cache_path(), and the package's own helpers before and after) — this is the single most important validation step..env.example and deployment docs to document the XDG variables and their fallbacks.Compatibility: v1.5.0 widens the constraint to include Laravel 12. Confirm the package is not pinned below the version you need and that no transitive constraint (e.g., illuminate/support) is held back. Watch for the case where the package's Laravel 12 support lands but its PHP floor lags your runtime.
Sequencing:
^1.5 if and only if a Laravel 12 upgrade is on the roadmap; otherwise ^1.4 remains fine and there is no reason to churn.Maintenance: Minimal ongoing cost — no runtime services, no migrations, no scheduled tasks. The real maintenance cost is dependency hygiene: because it is a small single-maintainer package, budget for a periodic (quarterly) review of releases and a standing willingness to vendor/fork if it goes stale. Pin to a caret range and rely on lockfile discipline.
Support: Community-only, best-effort, GitHub issues. There is no vendor SLA. Acceptable for internal tooling and developer-facing environments; a weaker proposition for anything customer-facing where path resolution failures page someone at 3 a.m.
Scaling: Negligible. Path resolution happens once at boot; no per-request overhead, no I/O amplification, no impact on horizontal scaling. The one scaling caveat is fleet consistency: if XDG variables are set per-host or per-user rather than baked into the image/manifest, instances can silently diverge in where they write cache and logs. Standardize via image build or orchestrator env, never via interactive shell profiles.
Failure modes:
www-data/php-fpm. Mitigation: pre-create with explicit ownership in the image or entrypoint.$HOME in containers — fallback behavior becomes undefined or unexpected. Mitigation: test the exact container image with HOME unset.Ramp-up: Very low — a competent Laravel engineer understands the entire surface in a few hours, and the XDG spec itself is a short read. The non-obvious knowledge is environmental (which hosts set which variables, where the log shipper reads from), so capture that in the runbook rather than relying on tribal knowledge.
How can I help you explore Laravel packages today?