'$refresh', 'closeModal' => '$refresh', ]; public bool $searchable = true; public array $searchableColumns = ['display_name', 'hostname']; public function query(): Builder { return Host::query()->with(['hostGroups']); } public function headers(): array { return [ 'display_name' => 'display_name', 'hostname' => 'hostname', 'host_groups' => 'host_groups', ]; } public function remove($host_id){ Host::find($host_id)->delete(); } public function columnHostGroups(mixed $column): mixed { return implode(", " , $column->pluck('name')->toArray()); } public function actions($item) { return [ [ 'type' => "livewire", 'action' => "edit", 'text' => "edit", 'parameters' => $item['id'] ], [ 'type' => "livewire", 'action' => "remove", 'text' => "remove", 'parameters' => $item['id'] ] ]; } public function edit($host_id) { $this->dispatch('openModal', 'host.form', __('boilerplate::host.edit'), ['model' => $host_id]); } }