PHPackages                             spescina/pkg-support - 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. spescina/pkg-support

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

spescina/pkg-support
====================

Support config and language classes for creating laravel packages

1.0.3(11y ago)1219MITPHPPHP &gt;=5.3.0

Since Apr 13Pushed 11y ago1 watchersCompare

[ Source](https://github.com/spescina/pkg-support)[ Packagist](https://packagist.org/packages/spescina/pkg-support)[ RSS](/packages/spescina-pkg-support/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

[![Build Status](https://camo.githubusercontent.com/79e1f558367c5898371c91335fc67ec60651c052def89420c3901310f6e0b3e8/68747470733a2f2f7472617669732d63692e6f72672f7370657363696e612f706b672d737570706f72742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/spescina/pkg-support?branch=master)[![Coverage Status](https://camo.githubusercontent.com/67ba654f66299803f1590028dd4cde45377e27c3ea3690e21612a2161220107c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7370657363696e612f706b672d737570706f72742f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/spescina/pkg-support?branch=master)

Package Development Support
===========================

[](#package-development-support)

Support config and language classes for creating laravel packages

Install &amp;&amp; Usage
------------------------

[](#install--usage)

Add in the target package `composer.json`

```
"require": {
    "spescina/pkg-support": "1.x"
}

```

Let the main package class implements the `Spescina\PkgSupport\PackageInterface`.
In the same class import the `Spescina\PkgSupport\PkgTrait` trait. Now the constructor has to respect the interface definition.

```
public function __construct(ServiceInterface $config, ServiceInterface $lang)
{
        $this->config = $config;
        $this->lang = $lang;
}

```

Then you should take care of these dependencies when instantiating the object, usually in the package service provider.

```
$this->app['mypackage'] = $this->app->share(function($app) {
        return new MyPackage(new Config('mypackage'), new Lang('mypackage'));
});

```

This constructor force the creation of a config and a lang object keeping the registration key for your package. With them, it will be possible to use Laravel Config and Lang facades from the package classes without having to specify the package prefix every time.
Assuming your class has a facade, you can now make these calls

- `MyPackage::conf()` equal to `Config::get('mypackage::mypackage')`
- `MyPackage::conf('key')` equal to `Config::get('mypackage::mypackage.key')`
- `MyPackage::conf('key', 'section')` equal to `Config::get('mypackage::section.key')`
- `MyPackage::lang('key')` equal to `Lang::get('mypackage::mypackage.key')`
- `MyPackage::lang('key', 'section')` equal to `Lang::get('mypackage::section.key')`

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~78 days

Total

4

Last Release

4225d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1da812cfabeba8d2a2a658ffa61204f0e5ccbb70dc3b81fc6cebf0eb28f8f73f?d=identicon)[simonpex](/maintainers/simonpex)

---

Top Contributors

[![spescina](https://avatars.githubusercontent.com/u/1956604?v=4)](https://github.com/spescina "spescina (14 commits)")

---

Tags

laravelconfigpackagelang

### Embed Badge

![Health badge](/badges/spescina-pkg-support/health.svg)

```
[![Health](https://phpackages.com/badges/spescina-pkg-support/health.svg)](https://phpackages.com/packages/spescina-pkg-support)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

143165.6k](/packages/bensampo-laravel-embed)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40140.4k2](/packages/erlandmuchasaj-laravel-gzip)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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