PHPackages                             hadefication/vormir - 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. [Templating &amp; Views](/categories/templating)
4. /
5. hadefication/vormir

ActiveLibrary[Templating &amp; Views](/categories/templating)

hadefication/vormir
===================

Doi package for Laravel to server side render using Spatie's server-side-rendering package with focus on Node engine.

v0.1.0(7y ago)2161[1 PRs](https://github.com/hadefication/vormir/pulls)MITPHP

Since May 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/hadefication/vormir)[ Packagist](https://packagist.org/packages/hadefication/vormir)[ RSS](/packages/hadefication-vormir/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Vormir
======

[](#vormir)

Just another attempt to do server side rendering in Laravel using [Spatie's](https://github.com/spatie) fantastic [server-side-rendering](https://github.com/spatie/server-side-rendering) package with focus on the Node engine. This package will expose a blade directive `@ssr` that you can include to your blade files as if you are including a JavaScript file. Since this package focuses on the Node engine of [Spatie's](https://github.com/spatie) [package](https://github.com/spatie/server-side-rendering), so you need to have [Node.js](https://nodejs.org/) installed in your stack.

Also, be sure to check this [article](https://vuejsdevelopers.com/2017/11/06/vue-js-laravel-server-side-rendering/) for more details on the server side rendering workflow and this [article](https://medium.com/walmartlabs/the-benefits-of-server-side-rendering-over-client-side-rendering-5d07ff2cefe8) as to why you should do server side rendering. As to who's this package for, kindly check this [section](https://github.com/spatie/server-side-rendering#whos-this-package-for) of [Spatie's](https://github.com/spatie) [package](https://github.com/spatie/server-side-rendering) readme.

Usage
-----

[](#usage)

1. Add this package to your Laravel applications by running `composer require hadefication/vormir`
2. Publish the config file by running `php artisan vendor:publish --provider="Hadefication\Vormir\VormirServiceProvider" --tag="config"` or `php artisan vendor:publish` and enter the number of this package showed in the console.
3. Locate your [Node.js](https://nodejs.org/) bin path by running `which node` and add it to your `.env` file as `SSR_NODE_BIN_PATH`.
4. Start mixing (Laravel Mix) or start building if you have your own build workflow. The build process should export two entry files, one that will be used for the client/web and one is for the server (ssr). The server entry file is the one that you will feed into the @ssr directive.
5. Add `@ssr('path/to/your/server-entry.js', $payload, $env)` to you blade and that's it!

Config
------

[](#config)

```
// Enable server side rendering. When disabled, the client
// script and the fallback html will be rendered instead.
'enabled' => true,

// Set to true to enable debugging, this will return all
// errors returned by the render (js errors)
'debug' => true,

// Additional environment variables to be loaded
'env' => [],

// The path of where the server entry file sits
'js_path' => public_path('js'),

// Node engine specific
'node' => [

    // Node.js bin path
    'bin_path' => env('SSR_NODE_BIN_PATH', ''),

    // The temp path where the compiled js file to be saved,
    // it will then eventually removed once the script
    // has been executed.
    'temp_path' => storage_path('app/public')

],

```

`@ssr($entry, $payload, $env)`
------------------------------

[](#ssrentry-payload-env)

The blade directive accepts three parameters where the first is required and the other two are optional.

- `$entry` - accepts a string path of the server entry file to render. Be sure to load/add/export your server entry files inside the `js_path` config. By default the `js_path` is set to `public_path('js')` or `public/js` (depending on your setup). So if you supplied the entry param like `@ssr('app/server-entry.js')` then the renderer will look for a file in the path `public/js/app/server-entry.js`.
- `$payload` - accepts a key-value array (assoc). The payload will be made available in your server entry file via `context` variable. Given that you have `@ssr('app/server-entry.js', ['foo' => 'bar'])`, the variable `foo` will now be accessible in your server entry file via `context.payload.foo`.
- `$env` - accepts a key-value array (assoc). Addition environment variables to be loaded on render (ssr).

Vue
---

[](#vue)

```
// config
...

'env' => ['VUE_ENV' => 'server']

```

```
// App.vue

        Hello cold world

```

```
// App.js

import App from './path/to/component/App.vue';

export default new Vue({
    render: h => h(App)
});

```

```
// client-entry.js

import app from './path/to/App.js';

app.$mount('#app');

```

```
// server-entry.js

import app from './path/to/App.js';
// yarn add vue-server-renderer or npm i vue-server-renderer
import renderVueComponentToString from 'vue-server-renderer/basic';

renderVueComponentToString(app, (err, res) => dispatch(res));

```

```
// Blade

        @ssr('path/to/server-entry.js')

```

React
-----

[](#react)

```
// App.js

import React, { Component } from 'react';

export default class App extends Component {
    render() {
        return (

                Hello cold world

        );
    }
}

```

```
// client-entry.js

import React from 'react';
import App from './components/App';
import { hydrate } from 'react-dom';

hydrate(, document.getElementById('root'));

```

```
// server-entry.js

import React from 'react';
import App from './components/App';
import { renderToString } from 'react-dom/server';

dispatch(renderToString());

```

```
// Blade

        @ssr('server-entry.js')

```

Credits
-------

[](#credits)

- [All Contributors](https://github.com/hadefication/vormir/contributors)
- [Jose Lo](https://github.com/jdltechworks)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/hadefication/vormir/blob/master/LICENSE) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

Total

2

Last Release

2913d ago

### Community

Maintainers

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

---

Top Contributors

[![hadefication](https://avatars.githubusercontent.com/u/6673244?v=4)](https://github.com/hadefication "hadefication (13 commits)")

---

Tags

laravelpackagessr

### Embed Badge

![Health badge](/badges/hadefication-vormir/health.svg)

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

###  Alternatives

[cagilo/cagilo

A set of open-source Blade components for the Laravel Framework

172996.5k](/packages/cagilo-cagilo)[orchid/blade-icons

An easy way inline SVG images in your Blade templates.

223.4M9](/packages/orchid-blade-icons)[wireui/heroicons

The Tailwind Heroicons for laravel blade by WireUI

43390.8k5](/packages/wireui-heroicons)[stillat/antlers-components

2656.0k1](/packages/stillat-antlers-components)[itstructure/laravel-grid-view

Grid view for laravel framework

2546.6k2](/packages/itstructure-laravel-grid-view)[ycs77/inertia-laravel-ssr-head

Simple SSR Head for Inertia Laravel

3211.5k](/packages/ycs77-inertia-laravel-ssr-head)

PHPackages © 2026

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