PHPackages                             wallacemaxters/laravel-navalha - 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. wallacemaxters/laravel-navalha

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

wallacemaxters/laravel-navalha
==============================

A small library to transform your laravel in alpinejs template

0.0.4(1y ago)05MITPHP

Since Feb 15Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (5)Used By (0)

Navalha
=======

[](#navalha)

🇧🇷🇧🇷🇧🇷🇧🇷🇧🇷🇧🇷🇧🇷🇧🇷🇧🇷🇧🇷🇧🇷

Navalha (is a joke with "Razor" name in portuguese) is a small framework written for Laravel, which allows binding of Laravel data on the server-side to AlpineJS variables.

How to Install
--------------

[](#how-to-install)

Run the follow command to install Navalha.

```
composer require wallacemaxters/laravel-navalha
```

And publish assets

```
php artisan vendor:publish --tag=navalha-assets
```

Now, your need to add `@navalhaStyles` and `@navalhaScripts` in the `` tag of your template.

Generate a Component
--------------------

[](#generate-a-component)

```
php artisan navalha:make-component Products
```

This command will generate `resources/views/navalha/products.blade.php` view and `app/Navalha/Products.php` class.

To render the component, your need to writen the follow code:

```
@navalha("Products")
```

Navalha component example
-------------------------

[](#navalha-component-example)

In follow example, we will paginate the data of `Product` Eloquent model in server-side component. In the view, the values will be convert to AlpineJs variables.

See:

```
namespace App\Navalha;

use App\Models\Product;
use WallaceMaxters\Navalha\Component;

class Products extends Component
{
    public function mount(): void
    {
        $this->paginate(1);
    }

    protected function data(): array
    {
        return [
            'page'     => 1,
            'products' => null,
        ];
    }

    public function paginate(int $page)
    {
        $this['products'] = Product::query()->paginate(3, page: $page);
        $this['page'] = $page;

        // or
        // $this->set('page', $page);
    }

    public function render()
    {
        return view("navalha.products");
    }
}
```

Code of `resources/views/navalha/products.blade.php`:

```

    Carregando...

```

Code of `welcome.blade.php`:

```

    @navalhaStyles
    @vite(['resources/css/app.css'])
    @navalhaScripts

        Navalha Example
        @navalha('Products')

```

Code of route:

```
Route::view('/', 'welcome');
```

Navalha special frontend variables and methods
----------------------------------------------

[](#navalha-special-frontend-variables-and-methods)

   Variable Type Description     $n.$busy(String|undefined) Function Indicates that an specifiy or any method is called from the server.   $n.$errors(String|undefined) Function Get an or many validation errors.   $n.\[method\]() Function Call a public method of component in Laravel side.   $n Object This a special object from Navalha that allows make methods call like $call().  Handle Server Errors
--------------------

[](#handle-server-errors)

Your can detect errors on call Navalha method with `navalha-errors` event.

Example:

```

    Test

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance45

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

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

Total

4

Last Release

432d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/983cda3e30a5a58d250f3bef7360267e0185b46e891f2f08e6683d0af9a9ddc7?d=identicon)[wallacemaxters](/maintainers/wallacemaxters)

---

Top Contributors

[![wallacemaxters](https://avatars.githubusercontent.com/u/5245865?v=4)](https://github.com/wallacemaxters "wallacemaxters (21 commits)")

---

Tags

alpinejsbladecomponentslaravel

### Embed Badge

![Health badge](/badges/wallacemaxters-laravel-navalha/health.svg)

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[livewire/blaze

A tool for optimizing Blade component performance by folding them into parent templates

688221.3k17](/packages/livewire-blaze)[laravellux/html

HTML and Form Builders for the Laravel Framework

35239.2k3](/packages/laravellux-html)[konekt/html

HTML and Form Builders for the Laravel Framework

24403.2k5](/packages/konekt-html)[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)

PHPackages © 2026

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