Files
portal-api/app/View/Components/Module/Os.php
T
2025-07-24 16:18:27 +07:00

46 lines
1.1 KiB
PHP

<?php
namespace App\View\Components\Module;
use App\Repositories\OsGroup\OsGroupRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Os extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null,
public OsGroupRepositoryInterface $osGroupRepository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$lists = null;
if($this->model && (
isset($this->model->ipaddress->modulVe_host_id) ||
isset($this->model->module_host_id)
))
{
$lists = $this->osGroupRepository->filter(
[
'module_host_id' => $this->model->ipaddress->module_host_id ?? $this->model->module_host_id
],
[],
[],
['id', 'name']
);
}
return view('components.module.os',compact('lists'));
}
}