bfg/livewire is a Laravel package for finder for the livewire.
It currently has 2 GitHub stars and 70 downloads on Packagist (latest version 1.4.0).
Install it with composer require bfg/livewire.
Discover more Laravel packages by bfg
or browse all Laravel packages to compare alternatives.
Last updated
Extension for the Livewire package.
Adds finder for components and extend with:
composer required bfg/livewire
@extends('livewire::document')
@section('head')
<title>Main</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
@endsection
@section('body')
@yield('content')
@endsection
@section('footer')
@endsection
Access:
window.Turbolinks.visit("/edit", { action: "replace" })
Access:
window.Swal.fire('Any fool can use a computer')
Access:
window.Toastr.info('Are you the 6 fingered man?')
Simple Swal access:
class MyComponent extends \Livewire\Component
{
...
public function submit() {
$this->emit('swal', [
'icon' => 'error',
'title' => 'Oops...',
'text' => 'Something went wrong!',
'footer' => '<a href="">Why do I have this issue?</a>'
]);
}
...
}
Swal confirm access:
...
$this->emit('swal:confirm', [
'title' => 'Do you want to save the changes?',
'text' => 'Save changes',
'confirmEvent' => 'livewireEvent', // You livewire event
'confirmParams' => ['user_id' => 1], // You livewire event parameters
]);
...
Swal message access:
...
$this->emit('swal:success', [
'title' => 'Changes saved!',
'text' => 'All you changes is saved'
]);
// Or
$this->emit('swal:success', [ // Can be: success, error, warning, info
'Changes saved!',
'All you changes is saved'
]);
...
Toastr message access:
...
$this->emit('toastr:success', 'Changes saved!');
$this->emit('toastr:success', [ // Can be: success, error, warning, info
'Changes saved!',
'All you changes is saved',
['timeOut' => 5000]
]);
...
Turbolinks visit access:
...
$this->emit('visit', '/edit');
// Or
$this->emit('visit', [
'/edit', ['action' => 'replace']
]);
...
For inject folder you can do this:
Bfg\Livewire\LivewireComponentsFinder::directory('Admin\\Pages', __DIR__.'/../Pages');
LivewireComponentsFinder::directory(string $namespace, string $path);