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

41 lines
1.0 KiB
PHP

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