DEV Community

Jefferson Silva
Jefferson Silva

Posted on

I built a framework to turn Laravel + Livewire apps into desktop & mobile apps using PHP WebAssembly, no Electron, no React Native

Hey everyone,

I've been working on a side project called NativeBlade and wanted to share it with the community.

The idea is simple: take your Laravel + Livewire app and run it as a native desktop or mobile application. No server needed. No Electron. No JavaScript frameworks. Just PHP and Blade.

How it works

Your entire Laravel application gets bundled and runs inside a PHP WebAssembly runtime, wrapped in a https://v2.tauri.app shell. The architecture looks like this:

  • PHP 8.3 runs in the browser via WebAssembly

  • Blade templates and Livewire components work as-is

  • SQLite database persists to IndexedDB (survives app restarts)

  • Native shell components (header, bottom nav, drawer) render outside the WebView — no flicker during navigation

  • Native OS features (dialogs, notifications, system tray) work through a bridge

The whole thing started as a weekend experiment: "what if I could just composer require something and turn my Laravel app into a desktop app?"

What it can do

  • Desktop: Windows, macOS, Linux with native menus and system tray

  • Mobile: Android & iOS with status bar, safe area, swipe back

  • External HTTP requests: Http::get() works transparently through a JS bridge — PHP signals what it needs, JavaScript makes the real fetch, PHP re-executes with the cached

response. You can even use NativeBlade::pool() to run multiple requests in parallel via Promise.all()

  • 1,512 built-in icons from https://phosphoricons.com/ — works in both shell components and Blade templates

  • Hot reload during development via a Vite plugin that watches PHP/Blade files

  • Offline-first — everything runs client-side, no internet required after install

That's it. Your Laravel app is now a desktop application.

What doesn't work

I want to be upfront about the limitations. Since PHP runs in WebAssembly, there's no real server:

  • No queues/jobs — no background worker process

  • No mail — no SMTP from WASM

  • No MySQL/Postgres — SQLite only

  • No sessions — uses a built-in state management instead

  • No cron/scheduling

  • Http::get() works but through a bridge (not native PHP networking)

It's not meant to replace server-side Laravel. It's for apps that run locally and don't need a backend, think tools, dashboards, utilities, offline apps.

Why I'm sharing this

This started as a learning project and I'd love to get feedback from the PHP community. The codebase touches a lot of interesting areas:

  • PHP WebAssembly internals

  • Tauri 2 (Rust-based alternative to Electron)

  • Livewire's lifecycle inside a non-standard runtime

  • Bridging sync PHP with async JavaScript

If any of this sounds interesting to you — whether you want to contribute, experiment, or just tell me what I'm doing wrong — I'd appreciate it.

GitHub: https://github.com/NativeBlade/NativeBlade

Happy to answer any questions!

Top comments (3)

Collapse
 
shahzamandev profile image
Sheikh Shahzaman

Skipping Electron entirely is a bold move. Curious how it handles OS-level APIs.

Collapse
 
jeffsynister profile image
Jefferson Silva

Tauri 2 actually gives us more OS-level access than Electron does out of the box. Our bridge layer maps PHP calls to native plugins:

  • Camera, Gallery — capture + compression
  • Biometric — Face ID, fingerprint auth
  • Haptics — vibration, impact, selection feedback
  • Geolocation — GPS
  • NFC, Barcode/QR — native scanning
  • Native Filesystem — real Documents, Downloads, AppData (not just WASM sandbox)
  • System Tray — icon, menu, hide-on-close
  • Native Menus — full menu bar
  • Clipboard, Notifications, Dialogs — all native
  • Deep Links — custom URL scheme
  • OS Info — platform, version, arch, locale

All through Livewire directives: wire:nb-bridge="camera", wire:nb-bridge="biometric", etc. No JavaScript needed from the developer.

The real advantage over Electron: Tauri plugins are Rust-native, not JS wrappers. Things like biometric auth, haptics, and NFC are official Tauri plugins that talk directly to the OS. Electron needs third-party Node modules for most of these, and some (haptics, NFC) simply don't exist.

And the binary? ~15MB vs Electron's ~150MB. No bundled Chromium — Tauri uses the OS webview.

Collapse
 
shahzamandev profile image
Sheikh Shahzaman

15MB vs 150MB is a massive win. Rust-native plugins make sense.