PHPackages                             mdkieran/inscribed - 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. mdkieran/inscribed

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

mdkieran/inscribed
==================

Pass constants to your JavaScript frontend.

v1.0.4(1y ago)011MITPHPPHP ^8.3

Since Jan 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mdkieran/inscribed)[ Packagist](https://packagist.org/packages/mdkieran/inscribed)[ RSS](/packages/mdkieran-inscribed/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Inscribed
=========

[](#inscribed)

Share your Laravel constants with JavaScript.

About
-----

[](#about)

This lightweight Laravel package makes it easy to share your application's constants, config values, and other static data with your frontend in an organized and efficient way. The data is "inscribed" onto the browser's window object, where it lives for the lifecycle of the page.

During development, the `@inscribed` blade directive will output something like:

```
window.Inscribed||={};window.Inscribed['example']=JSON.parse('{\u0022attribute\u0022:\u0022value\u0022}');
```

During production, so that the browser can benefit from caching, you'll see something like:

```

```

Additionally, there's a JavaScript helper function that you can publish to your project which helps you to retrieve the window object's "inscribed" data.

Features
--------

[](#features)

This package allows you to:

- Share Laravel constants with JavaScript.
- Organize your constants into groups.
- Compile your constants for production use.
- Use it with Inertia.js or any other frontend.
- Retrieve the data using a helper function (optional).

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

[](#installation)

### \[1/5\] Composer

[](#15-composer)

```
composer require mdkieran/inscribed
```

### \[2/5\] Publish an example class

[](#25-publish-an-example-class)

The following command will publish `App\Inscribed\ExampleInscribed.php` to your project:

```
php artisan vendor:publish --tag=mdkieran-inscribed-php
```

### \[3/5\] Register the example class

[](#35-register-the-example-class)

Open up a Service Provider class and add the following:

```
public function register(): void
{
    $this->app->singleton('inscribed.fqns', function () {
        return [
            \App\Inscribed\ExampleInscribed::class,

            // You can add more here...
        ];
    });
}
```

### \[4/5\] Include the blade directive

[](#45-include-the-blade-directive)

Include the blade directive in your layout file.

```

        ...
        @inscribed

        ...

```

Once you've included the blade directive, you should be able to type `window.Inscribed` into your browser's console and see the data from `ExampleInscribed`. That's pretty much it, you're all set.

### \[5/5\] Publish the JavaScript helper (Optional)

[](#55-publish-the-javascript-helper-optional)

The following command will publish `resources/js/inscribed.js` to your project, which can help you to easily retrieve the "inscribed" data. You may integrate it into your project as you wish:

```
php artisan vendor:publish --tag=mdkieran-inscribed-js
```

Caching
-------

[](#caching)

To prepare your app for production or the local environment you can run:

```
php artisan inscribed:cache
php artisan inscribed:clear
```

**Note:** After running either of the above commands you will need to run: `php artisan view:clear` to ensure the new markup can be included.

Or if you prefer, there's integration with Laravel's optimize commands so you could also run:

```
php artisan optimize
php artisan optimize:clear
```

### How does caching work?

[](#how-does-caching-work)

Caching works by taking each "Inscribed" class that you have in your project and making a JavaScript file for it that holds all of the static data that the class returned. Once done, we then make the file `bootstrap/cache/inscribed.php` which stores the list of JavaScript files that we just made.

The blade directive looks for `bootstrap/cache/inscribed.php`, if it finds it then it fetches the list of JavaScript files (from within it) and prints out script tags for each one. If it doesn't find `bootstrap/cache/inscribed.php` then it instantiates each of your inscribed classes to produce inline JavaScript that holds your static data.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance44

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Total

5

Last Release

443d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/151630dc2128fc75102011ebd59e9d95c71e052e2109c9647354ba22bde47f6a?d=identicon)[mdkieran](/maintainers/mdkieran)

---

Top Contributors

[![mdkieran](https://avatars.githubusercontent.com/u/4966149?v=4)](https://github.com/mdkieran "mdkieran (8 commits)")

---

Tags

inertiajslaravel

### Embed Badge

![Health badge](/badges/mdkieran-inscribed/health.svg)

```
[![Health](https://phpackages.com/badges/mdkieran-inscribed/health.svg)](https://phpackages.com/packages/mdkieran-inscribed)
```

###  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)
