bfg / livewire
Finder for the Livewire
Installs: 62
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:bfg-app
Requires
- php: ^7.2.5|^8.0
- livewire/livewire: ^2.5
README
Extension for the Livewire
package.
Adds finder for components and extend with:
Install
composer required bfg/livewire
Usage
View
@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
Turbolinks
- @turbolinks(false) - Disabling Turbolinks on Specific Links
- @turbolinksEval - Working with Script Elements
- @turbolinksPermanent - Persisting Elements Across Page Loads
- @turbolinksTrackReload - Reloading When Assets Change
- @turbolinksActionReplace - Application Visits
Access:
window.Turbolinks.visit("/edit", { action: "replace" })
SweetAlert2
Access:
window.Swal.fire('Any fool can use a computer')
Toastr
Access:
window.Toastr.info('Are you the 6 fingered man?')
Livewire Events
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'] ]); ...
Extending
For inject folder you can do this:
Bfg\Livewire\LivewireComponentsFinder::directory('Admin\\Pages', __DIR__.'/../Pages');
LivewireComponentsFinder::directory(string $namespace, string $path);