PHPackages                             kkszymanowski/laravel-js-config - 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. kkszymanowski/laravel-js-config

ActiveLibrary

kkszymanowski/laravel-js-config
===============================

Publish Laravel configuration to JS

1.0.9(3y ago)06.9k↓42.3%1MITPHPPHP ^7.1|8.\*

Since Sep 5Pushed 3y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (11)Used By (0)

### Laravel-JS-Config

[](#laravel-js-config)

Easily publish your Laravel configuration to JavaScript.

#### Requirements

[](#requirements)

- PHP 7.\*
- Laravel &gt;= 5.2

#### Installation

[](#installation)

```
composer require kkszymanowski/laravel-js-config

```

On Laravel &lt; 5.5 add `LaravelJsConfig\LaravelJsConfigServiceProvider::class` to `app/config.php`.

On Laravel &gt;= 5.5 the service provider should be automatically discovered.

#### Publish assets

[](#publish-assets)

```
php artisan vendor:publish

```

#### Configure

[](#configure)

In `config/js-config.php` there are following configuration options.

##### Output

[](#output)

Path of the output file generated from the command. By default `resources/assets/js/config.js`

##### Pretty

[](#pretty)

If true, the command will format the JSON configuration using `JSON_PRETTY_PRINT`.

##### Keys

[](#keys)

List of configuration keys to be published. Can be either a specific key(like `app.env`) or a group of keys(like `auth.defaults`)

**Make sure you don't publish your application key or any passwords.**

#### Run

[](#run)

```
php artisan config:js

```

#### Integration with Laravel Mix

[](#integration-with-laravel-mix)

To publish the configuration every time the Mix build starts follow these steps:

1. Install `webpack-shell-plugin`: ```
    # NPM
    npm install webpack-shell-plugin --save-dev

    # Yarn
    yarn add webpack-shell-plugin

    ```
2. In your `webpack.mix.js` file require the plugin ```
    const WebpackShellPlugin = require('webpack-shell-plugin');

    ```

    and register it to run before each build ```
    mix.webpackConfig({
        plugins: [
            new WebpackShellPlugin({
                onBuildStart: ['php artisan config:js'],
            }),
        ],
    });

    ```

If you're using the `watch` option in Laravel Mix and you want to refresh the published configuration you can either restart the build or run `php artisan config:js` in another terminal.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

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 ~208 days

Recently: every ~452 days

Total

10

Last Release

1303d ago

PHP version history (3 changes)1.0.0PHP 7.\*

1.0.6PHP ^7.1

1.0.8PHP ^7.1|8.\*

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13980973?v=4)[Kuba Szymanowski](/maintainers/KKSzymanowski)[@KKSzymanowski](https://github.com/KKSzymanowski)

---

Top Contributors

[![KKSzymanowski](https://avatars.githubusercontent.com/u/13980973?v=4)](https://github.com/KKSzymanowski "KKSzymanowski (11 commits)")

---

Tags

laraveljavascriptconfig

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kkszymanowski-laravel-js-config/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M601](/packages/laravel-ui)[laravel/breeze

Minimal Laravel authentication scaffolding with Blade and Tailwind.

3.0k31.3M148](/packages/laravel-breeze)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[laravel/wayfinder

Generate TypeScript representations of your Laravel actions and routes.

1.7k4.1M69](/packages/laravel-wayfinder)[mariuzzo/laravel-js-localization

Laravel Localization in JavaScript

6073.9M3](/packages/mariuzzo-laravel-js-localization)

PHPackages © 2026

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