malico / wired
Livewire utilities and macros for streamlined component development
0.1
2026-03-13 19:34 UTC
Requires
- php: ^8.2
- illuminate/support: ^11.0|^12.0|^13.0
- illuminate/view: ^11.0|^12.0|^13.0
README
Livewire utilities and macros for streamlined component development.
Installation
Add to composer.json:
{
"repositories": [
{
"type": "path",
"url": "../tinkerbin/wired"
}
],
"require": {
"malico/wired": "dev-main"
}
}
Then install:
composer install
The PHP service provider auto-registers.
Usage
Update your resources/js/app.js:
import { Livewire, Alpine, } from "../../vendor/livewire/livewire/dist/livewire.esm" import { registerDirectives } from '../../vendor/malico/wired/dist/index.js' // Register all wired directives registerDirectives(Livewire, Alpine) // Your custom setup Alpine.magic("paymentPhoneNumber", () => () => { return "+237 999 999 999" }) Livewire.start()
Available Directives
Alpine
x-placeholders
Autocomplete for placeholder tokens {field}.
<textarea x-placeholders="name, email, company"></textarea>
Type { to autocomplete. ESC to close.
x-email-mask
Validates email format: {field} or {name}<{email}>.
<input x-email-mask="name, email">
x-slug
Auto-formats to URL-safe slugs.
<input x-slug> <input x-slug="_">
Livewire
wire:slug
Auto-generates slug from another field.
<input wire:model="name" /> <input wire:model="slug" wire:slug="name" />
PHP Macros
$attributes->for(prefix)
Extract prefixed attributes.
<!-- Usage --> {{ $attributes->for('title') }} {{ $attributes->for('description') }}
Development
Build:
bun run build
Watch:
bun run watch