Update source into github
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?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'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user