1. Go to this page and download the library: Download salioudiabate/select 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/ */
salioudiabate / select example snippets
class EditPost extends Component
{
public ?int $authorId = null;
public function searchAuthors(string $query): array
{
return User::query()
->where('name', 'like', "%{$query}%")
->limit(20)
->get(['id', 'name'])
->map(fn ($user) => ['value' => $user->id, 'label' => $user->name])
->all();
}
public function render(): View
{
return view('livewire.edit-post', [
'author' => $this->authorId ? User::find($this->authorId) : null,
]);
}
}
js
function setSiteColorScheme(scheme) {
if (window.Notify) Notify.setColorScheme(scheme);
if (window.Modal) Modal.setColorScheme(scheme);
if (window.Select) Select.setColorScheme(scheme);
}