PHPackages                             mxent/pwax - 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. [Framework](/categories/framework)
4. /
5. mxent/pwax

ActiveLibrary[Framework](/categories/framework)

mxent/pwax
==========

Progressive Web App built with Laravel &amp; Vue

v1.51.0(1mo ago)048MITPHPPHP &gt;=8.2CI passing

Since Aug 16Pushed 3w agoCompare

[ Source](https://github.com/mxent/pwax)[ Packagist](https://packagist.org/packages/mxent/pwax)[ Docs](https://github.com/mxent/pwax)[ RSS](/packages/mxent-pwax/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (7)Versions (4)Used By (0)

mxent/pwax
==========

[](#mxentpwax)

Progressive Web App built with Laravel &amp; Vue

A Laravel package that seamlessly integrates Vue 3, Vue Router, and Pinia to build Progressive Web Applications with dynamic component loading and SPA-like experiences.

Features
--------

[](#features)

- 🚀 **Vue 3 Integration** - Modern reactive framework with Composition API support
- 🛣️ **Vue Router** - Client-side routing with hash or history mode
- 🗄️ **Pinia State Management** - Official Vue state management library
- 📦 **Dynamic Component Loading** - Load Vue components on-demand via AJAX
- ⚡ **Code Minification** - Automatic JS/CSS minification for optimal performance
- 🎨 **Customizable** - Extensive configuration options for plugins, directives, and middleware
- 🔄 **Hot Module Injection** - Dynamically inject CSS, JavaScript, and templates from Blade views

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Laravel &gt;= 12.0
- Composer

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

[](#installation)

Install the package via Composer:

```
composer require mxent/pwax
```

The service provider is auto-discovered by Laravel. After installation, run:

```
php artisan pwax:install
```

This publishes `config/pwax.php`. Pass `--views` to also publish the bundled Blade views, and `--force` to overwrite existing files.

Configuration
-------------

[](#configuration)

Publish the configuration file manually if you prefer:

```
php artisan vendor:publish --tag=pwax-config
```

Key options in `config/pwax.php`:

```
return [
    'hash_route'   => false,            // hash (#/) vs history routing
    'home'         => 'index',          // fallback named route
    'route_prefix' => '__pwax__',       // internal asset prefix

    'blade' => [
        'content' => null, 'head' => null, 'foot' => null,
        'error' => null, 'loader' => null,
    ],

    'customization' => [
        'init_spinner_color' => '#0c83ff',
        'init_spinner_bg'    => '#f3f3f3',
    ],

    'styles'  => [],
    'scripts' => [
        'https://unpkg.com/vue@3.5.18/dist/vue.global.prod.js',
        'https://unpkg.com/vue-router@4.5.1/dist/vue-router.global.prod.js',
        'https://unpkg.com/pinia@3.0.3/dist/pinia.iife.prod.js',
    ],

    'plugins'    => [],
    'directives' => [],
    'middleware' => [],

    'cache' => [
        'asset_ttl' => 3600,            // .js/.css cache lifetime
    ],

    'manifest_path' => '/manifest.webmanifest',
    'manifest' => [                     // Web App Manifest fields
        'name'        => env('APP_NAME', 'Pwax App'),
        'short_name'  => env('APP_NAME', 'Pwax'),
        'start_url'   => '/',
        'display'     => 'standalone',
        'theme_color' => '#0c83ff',
        'icons'       => [/* { src, sizes, type } */],
    ],

    'service_worker' => [
        'enabled'       => false,       // turn on to register /service-worker.js
        'path'          => '/service-worker.js',
        'cache_name'    => 'pwax-cache-v1',
        'precache'      => ['/'],
        'network_first' => true,
    ],
];
```

Progressive Web App
-------------------

[](#progressive-web-app)

Pwax serves a Web App Manifest at `/manifest.webmanifest` and a service worker at `/service-worker.js`. The bundled `` partial already emits the `` and `theme-color` meta tags.

To enable the service worker, set `service_worker.enabled = true` in `config/pwax.php`. The worker template can be customised by publishing it:

```
php artisan vendor:publish --tag=pwax-service-worker
```

Publishing Views
----------------

[](#publishing-views)

Publish the view files to customize the layout:

```
php artisan vendor:publish --tag=pwax-views
```

This publishes views to `resources/views/vendor/pwax/`.

Usage
-----

[](#usage)

### Creating a Vue Component

[](#creating-a-vue-component)

Create a Blade view that contains ``, ``, and `` sections:

```
{{-- resources/views/hello.blade.php --}}

        @{{ message }}
        Count: @{{ count }}

export default {
    data() {
        return {
            message: 'Hello from PWax!',
            count: 0
        }
    },
    methods: {
        increment() {
            this.count++
        }
    }
}

.hello {
    padding: 20px;
    text-align: center;
}

```

### Rendering a Component

[](#rendering-a-component)

In your controller, use the `vue()` helper function:

```
use Illuminate\Http\Request;

class HomeController extends Controller
{
    public function index()
    {
        return vue('hello');
    }

    public function profile()
    {
        return vue('profile', [
            'user' => auth()->user()
        ]);
    }
}
```

### Routing

[](#routing)

Define your routes as usual in `routes/web.php`:

```
Route::get('/', [HomeController::class, 'index'])->name('index');
Route::get('/profile', [HomeController::class, 'profile'])->name('profile');
Route::get('/about', [HomeController::class, 'about'])->name('about');
```

Use the `router()` helper to generate Vue Router compatible paths:

```

        Home
        Profile
        About

export default {
    //
}

```

### Dynamic Imports

[](#dynamic-imports)

Use the `import()` helper to dynamically import components:

```

export default {
    async mounted() {
        // Import a component
        const { default: MyComponent } = @import('components.my-component')

        // Import with variable assignment
        const MyModal = @import('MyModal from components.modal')
    }
}

```

Advanced Configuration
----------------------

[](#advanced-configuration)

### Custom Plugins

[](#custom-plugins)

Register custom Vue plugins in `config/pwax.php`:

```
'plugins' => [
    [
        'name' => 'myPlugin',
        'init' => 'app.use(MyCustomPlugin, { option: "value" })'
    ]
],
```

### Custom Directives

[](#custom-directives)

Add custom Vue directives:

```
'directives' => [
    [
        'name' => 'focus',
        'init' => 'app.directive("focus", { mounted(el) { el.focus() } })'
    ]
],
```

### Middleware

[](#middleware)

Execute JavaScript before component loads:

```
'middleware' => [
    [
        'name' => 'auth',
        'init' => 'if (!user.isAuthenticated) { window.location = "/login" }'
    ]
],
```

Security Best Practices
-----------------------

[](#security-best-practices)

- ⚠️ **View Names**: Only use trusted view names. The package validates view names to prevent path traversal attacks.
- 🔒 **Config Values**: Avoid adding user-supplied data directly to config arrays like plugins or directives.
- 🛡️ **CSRF Protection**: Ensure CSRF tokens are included in AJAX requests if modifying data.
- 📝 **Input Validation**: Always validate and sanitize user input in your components.

Testing
-------

[](#testing)

The test suite uses Orchestra Testbench:

```
composer test
```

Coverage report:

```
composer test-coverage
```

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for version history and updates.

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

Credits
-------

[](#credits)

- [Mxent Open Source Team](mailto:opensource@mxent.com)
- [All Contributors](../../contributors)

Support
-------

[](#support)

For issues, questions, or feature requests, please [open an issue](../../issues) on GitHub.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance92

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.4% 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 ~269 days

Total

2

Last Release

52d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/99265192?v=4)[Mikki](/maintainers/mikkiesco)[@mikkiesco](https://github.com/mikkiesco)

---

Top Contributors

[![mikkiesco](https://avatars.githubusercontent.com/u/99265192?v=4)](https://github.com/mikkiesco "mikkiesco (73 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (6 commits)")

---

Tags

laravelvuepwaProgressive Web AppSPApiniavue router

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3891.8k](/packages/codewithdennis-larament)

PHPackages © 2026

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