PHPackages                             b7s/lara-ink - 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. [API Development](/categories/api)
4. /
5. b7s/lara-ink

ActiveLibrary[API Development](/categories/api)

b7s/lara-ink
============

✒️ LaraInk - Turn your files into a standalone SPA with Alpine.js, powered by Laravel REST API + Bearer Token.

v0.1.2(6mo ago)30MITPHPPHP &gt;=8.3CI passing

Since Nov 3Pushed 5mo agoCompare

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

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

 [![[LaraInk]](docs/art/logo.webp)](docs/art/logo.webp)LaraInk
=======

[](#laraink)

[![PHP Version](https://camo.githubusercontent.com/62aeff98201d8b5641823c0f650139b2e355414fe60cbb72fe705f1c6c55505d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344382e332d626c7565)](https://php.net)[![Laravel Version](https://camo.githubusercontent.com/bd76703bda90660aa37f5e7f61101dc379ab2edd8a68a6460f0bb49548f3a061/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d25334525334431312e302d726564)](https://laravel.com)[![License](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)](LICENSE)

---

**Laravel Blade + Alpine.js = static to reactive SPAs in seconds.**

A powerful DSL compiler that transforms Blade-like files into an independent SPA with [Alpine.js](https://alpinejs.dev), communicating with Laravel via REST API using Bearer Token authentication

---

✨ Features
----------

[](#-features)

- 🚀 **Blade-to-Alpine.js Compiler** - Write familiar Blade syntax, get reactive Alpine.js components
- 📦 **Independent SPA** - Deploy your frontend anywhere (CDN, Netlify, Vercel, S3)
- 🔐 **Bearer Token Auth** - Secure API communication with Laravel Sanctum
- ⚡ **Smart Caching** - Page-level caching with configurable TTL
- 🎯 **Dynamic Routing** - File-based routing with parameter support
- 🌍 **i18n Ready** - Built-in translation system
- 🎨 **Layout System** - Reusable layouts with nested folder support
- 📱 **SPA Router** - Client-side navigation with prefetching
- 🔧 **PHP Variables** - Define variables in PHP blocks, auto-converted to Alpine.js reactive data
- 🛡️ **Type Safety** - Automatic type detection and validation for variables (string, int, float, bool, array, Collection, Eloquent)
- 🧪 **With a lot of tests**

---

📦 Installation
--------------

[](#-installation)

```
composer require b7s/lara-ink
```

Run the install command:

```
php artisan lara-ink:install
```

The package will automatically:

- Create required directories (`resources/lara-ink/`, `public/build/`, etc.)
- Publish configuration file to `config/lara-ink.php`
- Set up default layout
- Set up Vite plugin to project root

---

🚀 Quick Start
-------------

[](#-quick-start)

### 1. Create Your First Page

[](#1-create-your-first-page)

Create `resources/lara-ink/pages/index.php`:

```
