PHPackages                             pineblade/pineblade - 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. pineblade/pineblade

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

pineblade/pineblade
===================

Blade for frontend

v0.7.1(1y ago)15MITPHPPHP ^8.3

Since Jun 30Pushed 1y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (8)Versions (14)Used By (0)

[![](docs/img/header-logo.svg)](docs/img/header-logo.svg)

Pineblade
=========

[](#pineblade)

###### (Don't use this in production, this is just a personal project.)

[](#dont-use-this-in-production-this-is-just-a-personal-project)

PHP frontend for Laravel.
-------------------------

[](#php-frontend-for-laravel)

Writing reactive front-end with 100% PHP+Blade? Yes, take a look:

[![simple-counter.png](docs%2Fimg%2Freadme-snaps%2Fsimple-counter.png)](docs%2Fimg%2Freadme-snaps%2Fsimple-counter.png)

The code above produces:

[![counter-example.gif](docs%2Fimg%2Fcounter-example.gif)](docs%2Fimg%2Fcounter-example.gif)

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

[](#installation)

- Run to install the package with:

```
composer require pineblade/pineblade
```

- Publish the scripts:

```
php artisan vendor:publish --tag=pineblade-scripts
```

- Add the `@pinebladeScripts` at the end of the body tag in your html file.

How it works?
-------------

[](#how-it-works)

The PHP code is converted to javascript. The reactivity is achieved with the lightweight Alpine.js. Under the hood, it is just Alpine.js.

Wait, did you say the PHP code is converted to javascript?
----------------------------------------------------------

[](#wait-did-you-say-the-php-code-is-converted-to-javascript)

Yes. I used the nikic/php-parser to parse the code inside the block, and then I wrote a simple translator that outputs javascript from whatever php code is given. Check the source code, for more details.

The `#[Async]` attribute, and the `@` operator:
-----------------------------------------------

[](#the-async-attribute-and-the--operator)

In PHP, this operator is used to suppress errors. Here, it means `await`. It is used to wait asynchronous function calls.

[![async-await.png](docs%2Fimg%2Freadme-snaps%2Fasync-await.png)](docs%2Fimg%2Freadme-snaps%2Fasync-await.png)

The `#[Inject]` attribute:
--------------------------

[](#the-inject-attribute)

Used to inject blade variables with the same name as @code property values.

[![inject-1.png](docs%2Fimg%2Freadme-snaps%2Finject-1.png)](docs%2Fimg%2Freadme-snaps%2Finject-1.png)

The `server()` function:
------------------------

[](#the-server-function)

This is a special function, that only exists at compile time. With this function, you can create a closure that will be executed at server side and return the contents to the client side. Take a look: [![vv-2.png](docs%2Fimg%2Freadme-snaps%2Fvv-3.png)](docs%2Fimg%2Freadme-snaps%2Fvv-3.png)Also there is a `#[Server]` attribute that you can use to annotate the methods declared inside `@data`.

Important!
----------

[](#important)

Keep in mind that the client-side php code is just a direct translation. We can't use array\_\* functions or whatever any other php classes or functions we have in the server-side. Instead, you must use the client-side Objects/functions/methods/etc...

To map through an array, you should use the javascript -&gt;map() method:

```
// valid client-side code:
$array = [1, 2, 3];

$result = $array->map(fn ($val) => $val * 2);
```

**REMEMBER, IT IS THE JAVASCRIPT CONTEXT.**You are writing javascript code, but with the PHP syntax.

Custom blade directives
-----------------------

[](#custom-blade-directives)

- @text()
    - It's a shorthand for the alpine `x-text` directive. It will just place a `` tag with the `x-text`.
- @xforeach() / @xendforeach
    - Shorthand for `x-for` directive.
- @xif() / @xendif
    - Shorthand for `x-if` directive.

Alpine directives
-----------------

[](#alpine-directives)

All Alpine directives needs to be written in php. The contents of any `x-*` or `@*`, will be transpiled to php. Example:

```
Increment
```

In the `@click` attribute, we used the php first-class callable syntax.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance42

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Recently: every ~80 days

Total

13

Last Release

463d ago

PHP version history (2 changes)v0.1.0-alphaPHP ^8.2

v0.6.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c4d7b81b04cad437d9e4579d02e2a96c62320da264c82be0f5fb784034b49c2?d=identicon)[ErickJMenezes](/maintainers/ErickJMenezes)

---

Top Contributors

[![ErickJMenezes](https://avatars.githubusercontent.com/u/49132967?v=4)](https://github.com/ErickJMenezes "ErickJMenezes (116 commits)")

###  Code Quality

TestsPest

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[cagilo/cagilo

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

172996.5k](/packages/cagilo-cagilo)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[orchid/blade-icons

An easy way inline SVG images in your Blade templates.

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

TwigStan is a static analyzer for Twig templates powered by PHPStan

27412.1k](/packages/twigstan-twigstan)[wireui/heroicons

The Tailwind Heroicons for laravel blade by WireUI

43390.8k5](/packages/wireui-heroicons)

PHPackages © 2026

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