PHPackages                             engageinteractive/laravel-config-provider - 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. engageinteractive/laravel-config-provider

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

engageinteractive/laravel-config-provider
=========================================

Allows your users to change which config file your Laravel package uses at runtime.

1.2(2y ago)25.6k↓50%1MITPHP

Since Sep 13Pushed 2y ago6 watchersCompare

[ Source](https://github.com/engageinteractive/laravel-config-provider)[ Packagist](https://packagist.org/packages/engageinteractive/laravel-config-provider)[ RSS](/packages/engageinteractive-laravel-config-provider/feed)WikiDiscussions master Synced 1mo ago

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

Laravel Config Provider
=======================

[](#laravel-config-provider)

[![Build Status](https://camo.githubusercontent.com/9b1cf7d35c14e1ae5cb8af35e09aac0496cadd76422f5d7365a16a184c5883ac/68747470733a2f2f7472617669732d63692e6f72672f656e67616765696e7465726163746976652f6c61726176656c2d636f6e6669672d70726f76696465722e737667)](https://travis-ci.org/engageinteractive/laravel-config-provider)[![Total Downloads](https://camo.githubusercontent.com/78fdfe3cff6e39db019eb505d57463e95688a3a84e0ad881126f4031875312a0/68747470733a2f2f706f7365722e707567782e6f72672f656e67616765696e7465726163746976652f6c61726176656c2d636f6e6669672d70726f76696465722f642f746f74616c2e737667)](https://packagist.org/packages/engageinteractive/laravel-config-provider)[![Latest Stable Version](https://camo.githubusercontent.com/99df92f6570378cbda0b7d6b5ad07cb5e778bb386c3c7ec282289c139c8d2dc4/68747470733a2f2f706f7365722e707567782e6f72672f656e67616765696e7465726163746976652f6c61726176656c2d636f6e6669672d70726f76696465722f762f737461626c652e737667)](https://packagist.org/packages/engageinteractive/laravel-config-provider)[![License](https://camo.githubusercontent.com/954897dcbf843bc0ba572959fb2333f2c30bd29fd26b8256c56216ebc91d2263/68747470733a2f2f706f7365722e707567782e6f72672f656e67616765696e7465726163746976652f6c61726176656c2d636f6e6669672d70726f76696465722f6c6963656e73652e737667)](https://packagist.org/packages/engageinteractive/laravel-config-provider)

To avoid filename collisions between Laravel config files, use this package to allow your end users to change which file is accessed in your package.

Installation
------------

[](#installation)

```
composer require engageinteractive/laravel-config-provider
```

Now, in your package, create a new `ConfigProvider`:

```
namespace Example\Package;

use EngageInteractive\LaravelConfigProvider\ConfigProvider as BaseConfigProvider;

class ConfigProvider extends BaseConfigProvider
{
    /**
     * Key to use when retrieving config values. Override this if you require `Example\Package` to
     * a different file for its configuration.
     *
     * @var string
     */
    protected $configKey = 'example-package';
}
```

Then, rather than using the `Config` facade, or the `config()` function in Laravel, your package should use Laravel's service container to get access to a `ConfigProvider`:

```
namespace Example\Package;

use Illuminate\Support\ServiceProvider as BaseServiceProvider;

class ServiceProvider extends BaseServiceProvider
{
    /**
     * Prepare the App for your package.
     *
     * @return void
     */
    public function boot()
    {
        $this->publishes([
            __DIR__.'/../publishes/config/example-package.php' => config_path('example-package.php'),
        ], 'config');

        // Previous you could have done `config('example-package.enabled')`
        if (app(ConfigProvider::class)->get('enabled')) {
            // Do your thing!
        }
    }
}
```

Doing so will then allow end users of your package to change which file your package uses in by providing an alternative in their `AppServiceProvider`.

Config File Customisation
-------------------------

[](#config-file-customisation)

**\[Use this section to explain to your end users how to customise which file is used for your package. Don't forget to rename `example-package.php` to yours and delete this paragraph as well!\]**

By default the package uses the `config/example-package.php` file to define all the configuration settings. However, the package uses [Laravel Config Provider](https://github.com/engageinteractive/laravel-config-provider) to allow you change to which file is used. To do so bind your own instance of `ConfigProvider` in your `AppServiceProvider`. This is useful in cases where `config/example-package.php` is already in use within your project for example.

First create your own provider:

```
namespace App\Config;

use Example\Package\ConfigProvider;

class ExamplePackageConfigProvider extends ConfigProvider
{
    /**
     * Key to use when retrieving config values.
     *
     * @var string
     */
    protected $configKey = 'different-example-package';
}
```

Then, add the provider to your bindings on startup.

```
class AppServiceProvider extends ServiceProvider
{
...

    /**
     * All of the container bindings that should be registered.
     *
     * @var array
     */
    public $bindings = [
        \Example\Package\ConfigProvider::class => \App\Config\ExamplePackageConfigProvider::class,
    ];

...
}
```

The package uses `ConfigProvider` via the Laravel Service Container exclusively, so when we request it yours will be created instead.

Laravel Compatibility
---------------------

[](#laravel-compatibility)

Works on Laravel 5.5+.

License
-------

[](#license)

Laravel Config Provider is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~433 days

Total

5

Last Release

1069d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e22aa318e38eb714e24cfaaffbd8ec50c2866cb0c9c17b31425033cee39123db?d=identicon)[engageinteractive](/maintainers/engageinteractive)

---

Top Contributors

[![Roberth91](https://avatars.githubusercontent.com/u/6909290?v=4)](https://github.com/Roberth91 "Roberth91 (6 commits)")[![nadinengland](https://avatars.githubusercontent.com/u/882591?v=4)](https://github.com/nadinengland "nadinengland (1 commits)")[![wilkinsocks](https://avatars.githubusercontent.com/u/2356082?v=4)](https://github.com/wilkinsocks "wilkinsocks (1 commits)")

### Embed Badge

![Health badge](/badges/engageinteractive-laravel-config-provider/health.svg)

```
[![Health](https://phpackages.com/badges/engageinteractive-laravel-config-provider/health.svg)](https://phpackages.com/packages/engageinteractive-laravel-config-provider)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4205.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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