Write components in PHP and Blade, the way you would with Livewire. Unscripted runs
them in the browser, so clicks, typing and re-renders need no request.
Only the methods you mark #[Server] reach your Laravel app.
$ composer require unscripted/ui-server:dev-main
<?php
use App\Models\Todo;
use Unscripted\Ui\{Component, Server, State};
new class extends Component {
#[State] public string $draft = '';
// Runs on your Laravel app, called like a function.
#[Server]
public static function create(string $title): void
{
Todo::create(['title' => $title]);
}
// Runs in the browser. `yield` waits for the server.
public function add(): Generator
{
yield static::create($this->draft);
$this->draft = '';
}
};
?>
<form u-on:submit.prevent="add">
<input u-model="draft" placeholder="What needs doing?">
<button>Add</button>
</form>
One component file, two places it runs.
The page arrives as HTML, loaders and all, so it's there before any PHP loads in the browser.
PHP 8.4, compiled to WebAssembly, runs the same class. Actions, bindings and re-renders happen right there.
A #[Server] method's body stays on Laravel; the browser gets a stub that calls it, with validation and permissions.
The parts of Livewire you'd reach for, working without the round trips.
Blade templates, u-model, u-on:click, events, nested components and lifecycle hooks.
Laravel's validation rules, checked as you type in the browser and again on the server.
Server methods that fill a property on mount and run again when what they watch changes.
Change data on the server and every open page showing it updates, over Reverb or polling.
Text that arrives as it's made, and uploads with progress, kept safe until you store them.
Move between pages without loading PHP again, keeping what you choose across pages.
Games in Rust and WebGL, with Unscripted components for their menus, scores and results; and smaller demos of the framework itself.
All the examples →A counter, then a todo list with a database, in ten minutes.