PHPackages                             owenvoke/laravel-xdg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. owenvoke/laravel-xdg

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

owenvoke/laravel-xdg
====================

A Laravel adapter for the XDG Base Directory specification.

v1.5.0(1y ago)141811MITPHPPHP ^8.2CI passing

Since Feb 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/owenvoke/laravel-xdg)[ Packagist](https://packagist.org/packages/owenvoke/laravel-xdg)[ Fund](https://ecologi.com/owenvoke?gift-trees)[ GitHub Sponsors](https://github.com/owenvoke)[ RSS](/packages/owenvoke-laravel-xdg/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (7)Versions (8)Used By (1)

Laravel XDG
===========

[](#laravel-xdg)

[![Latest Version on Packagist](https://camo.githubusercontent.com/728d791ebf1191a567ce5676a76d04b01f16e6e89c8ec0ce2ae40c2ff84622c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f77656e766f6b652f6c61726176656c2d7864672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/owenvoke/laravel-xdg)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/fd8ef31480df80d9dfdcdddd296fe96dddb49e9c52aaac62004394abb010d66c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f77656e766f6b652f6c61726176656c2d7864672f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d5465737473)](https://github.com/owenvoke/laravel-xdg/actions)[![Static Analysis](https://camo.githubusercontent.com/4859b3eec5d8b52aa00eb4e1d42de117c51c5ecc5056a8718199eac5b090b961/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f77656e766f6b652f6c61726176656c2d7864672f7374617469632e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d537461746963253230416e616c79736973)](https://github.com/owenvoke/laravel-xdg/actions/workflows/static.yml)[![Total Downloads](https://camo.githubusercontent.com/a8de4fd76ec1a2a0c26f73ecd2fb59a5f16a3d6a8edd9ac5d29f771e1b9c56d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f77656e766f6b652f6c61726176656c2d7864672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/owenvoke/laravel-xdg)[![Buy us a tree](https://camo.githubusercontent.com/910e097fe46a40add8f3484705ecbc26dc047df84b2fef027405f47408023d76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d6c69676874677265656e3f7374796c653d666c61742d737175617265)](https://ecologi.com/owenvoke?gift-trees)

A Laravel adapter for the XDG Base Directory specification.

Install
-------

[](#install)

Via Composer

```
composer require owenvoke/laravel-xdg
```

Usage
-----

[](#usage)

```
use OwenVoke\LaravelXdg\Xdg;

// Resolving from the app container
app(Xdg::class)->getHomeDirectory();
app('xdg')->getHomeDirectory();

// Using the facade (with, and without the short alias)
\Xdg::getHomeDirectory();
\OwenVoke\LaravelXdg\Facades\Xdg::getHomeDirectory();
```

#### Available methods

[](#available-methods)

DescriptionMethod nameReturn ValueRetrieve the XDG home directory.`getHomeDirectory()`stringRetrieve the XDG home cache directory.`getHomeCacheDirectory()`stringRetrieve the XDG home config directory.`getHomeConfigDirectory()`stringRetrieve the XDG home data directory.`getHomeDataDirectory()`stringRetrieve the XDG runtime directory.`getRuntimeDirectory()`stringRetrieve all XDG config directories.`getConfigDirectories()`CollectionRetrieve all XDG data directories.`getDataDirectories()`CollectionChange log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Owen Voke](https://github.com/owenvoke)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Treeware
--------

[](#treeware)

You're free to use this package, but if it makes it to your production environment you are required to buy the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you support this package and contribute to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees [here](https://ecologi.com/owenvoke?gift-trees).

Read more about Treeware at [treeware.earth](https://treeware.earth).

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance46

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 91.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~309 days

Recently: every ~392 days

Total

7

Last Release

418d ago

Major Versions

v0.1.0 → v1.0.02020-02-20

PHP version history (4 changes)v0.1.0PHP ^7.4

v1.1.0PHP ^7.4|^8.0

v1.3.0PHP ^8.1

v1.4.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1899334?v=4)[Owen Voke](/maintainers/owenvoke)[@owenvoke](https://github.com/owenvoke)

---

Top Contributors

[![owenvoke](https://avatars.githubusercontent.com/u/1899334?v=4)](https://github.com/owenvoke "owenvoke (43 commits)")[![matt-h](https://avatars.githubusercontent.com/u/664294?v=4)](https://github.com/matt-h "matt-h (4 commits)")

---

Tags

laravelphpxdg-basedir

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/owenvoke-laravel-xdg/health.svg)

```
[![Health](https://phpackages.com/badges/owenvoke-laravel-xdg/health.svg)](https://phpackages.com/packages/owenvoke-laravel-xdg)
```

###  Alternatives

[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[illuminate/broadcasting

The Illuminate Broadcasting package.

7126.5M178](/packages/illuminate-broadcasting)[illuminate/redis

The Illuminate Redis package.

8314.0M314](/packages/illuminate-redis)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
