PHP code example of 23m / livewire-async
1. Go to this page and download the library: Download 23m/livewire-async library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
23m / livewire-async example snippets
use TTM\LivewireAsync\AsyncComponent;
class Customer extends AsyncComponent
{
public function renderAsync()
{
$heroes = Http::get('example.com/heroes')->json();
return view('livewire.api.heroes', compact('heroes'));
}
}
bash
$ php artisan livewire:make api.heroes