41 lines
1.0 KiB
PHP
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'));
|
|
}
|
|
}
|