PHP code example of sertxudeveloper / livewire-combobox
1. Go to this page and download the library: Download sertxudeveloper/livewire-combobox 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/ */
sertxudeveloper / livewire-combobox example snippets
namespace App\Livewire;
use App\Models\User;
use SertxuDeveloper\LivewireCombobox\Components\Combobox;
class UsersCombobox extends Combobox
{
/** @var class-string<Model> $model */
public string $model = User::class;
}
/**
* The column to be shown as the label.
*
* @var string
*/
public string $labelColumn = 'title'; // Default: 'name'
/**
* Apply filters to the query.
*
* @param Builder $query
* @return void
*/
protected function filter(Builder $query): void {
$query->where('email', 'like', "%@example.com");
}