New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

pharaonic/livewire-assistant

Shared Blade and JavaScript foundation that binds JavaScript widgets to Livewire components.
1,780 1
Install
composer require pharaonic/livewire-assistant
Latest Version:4.0.0
PHP:>=8.1 <8.6
Laravel:10 – 13
Older releases:7 · 8 · 9
License:MIT
Last Updated:Oct 29, 2026
Links: GitHub  ·  Packagist
Maintainer: Pharaonic

Livewire Assistant

PHP Version : 8.1 | 8.2 | 8.3 | 8.4 | 8.5 Laravel Version : 10.x | 11.x | 12.x | 13.x Livewire Version : 4.x License Build
Source Packagist Version Packagist Downloads

Bind JavaScript widgets such as Select2 to Livewire components.

Discovery, component ownership, a component bridge, and the mount, update, and cleanup lifecycle.

Installation

composer require pharaonic/livewire-assistant

The service provider is registered automatically. Load the runtime once in your layout, before or after Livewire's scripts:

@livewireScripts
@livewireAssistantScripts

No Node build is needed. The 4.x line supports Livewire 4.3.4+ on Laravel 10.16+, 11, 12, and 13 with PHP 8.1 to 8.5. For Livewire 1, 2, or 3, use the 1.x, 2.x, or 3.x line.

Laravel 10 and 11 no longer receive security fixes, so recent Composer versions refuse to install or update them until you allow laravel/framework; see the installation guide.

Usage

<div wire:ignore>
    <select data-pharaonic="select2" data-property="country_id">
        <option value="">Choose a country</option>
        <option value="1">Egypt</option>
    </select>
</div>
Pharaonic.assistant.register('select2', {
    mount({ element, property, options, component }) {
        const $element = jQuery(element).select2(options)

        $element.val(component.get(property) ?? '').trigger('change.select2')
        $element.on('change.pharaonicAssistant', () => component.set(property, $element.val()))
        component.watch(property, (value) => $element.val(value ?? '').trigger('change.select2'))

        return () => $element.off('.pharaonicAssistant').select2('destroy')
    },
})

Load this script after @livewireAssistantScripts, or register through window.PharaonicAssistantQueue so the order does not matter. jQuery and Select2 are your application's dependencies. The documentation has the complete Select2 integration, including loop prevention.

Documentation

Read the full Livewire Assistant documentation for installation, writing integrations, the component bridge, and examples.

Support & Security

See SUPPORT.md and SECURITY.md.

License

MIT. See LICENSE.

Related Packages

pharaonic/livewire-select2

Select2 for Livewire components: two-way wire:model binding, dynamic elements, a...

89,999 45
williamug/searchable-select

A beautiful, searchable dropdown component for Laravel Livewire 3 & 4 applicatio...

1,742 2
mrpunyapal/laravel-client-validation

Laravel validation rules for client-side with Alpine.js integration

51 11
laracasts/utilities

Transform your PHP to JavaScript

11,035,004 2,199
dasundev/livewire-dropzone

A Livewire Dropzone component for simple drag-and-drop file uploads.

133,473 231

Version History

Version Released PHP Laravel License
4.0.0 >=8.1 <8.6 ^10.16 || ^11.0 || ^12.0 || ^13.0 MIT
3.0.0 >=8.1 <8.6 ^10.15 || ^11.0 || ^12.0 || ^13.0 MIT
2.0.0 >=8.0 <8.4 ^7.30 || ^8.75 || ^9.0 || ^10.0 MIT
1.0.0 >=7.4 <8.0 ^7.30 || ^8.75 MIT