cristianhu06 / laravelv9x

Repositorio
2 stars 0 forks source link

Crear Buscador #2

Open cristianhu06 opened 1 year ago

cristianhu06 commented 1 year ago

Creacion del Buscador

Controller

protected $paginationTheme = 'bootstrap';
    public $selected_id, $keyWord, $nombre;

    public function render()
    {
    $keyWord = '%'.$this->keyWord .'%';
          return view('livewire.cargos.view', [
            'cargos' => Cargo::latest()
                ->orWhere('nombre', 'LIKE', $keyWord)

                ->paginate(10),
        ]);
    }

View

<div>
     <input wire:model='keyWord' type="text" class="form-control" name="search" id="search" placeholder="Search 
     Regiones">
</div>