Update source into github
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Module;
|
||||
|
||||
use App\Repositories\Module\Network\NetworkRepositoryInterface;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class Network extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct(
|
||||
public $model = null,
|
||||
public NetworkRepositoryInterface $networkRepository
|
||||
)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View|Closure|string
|
||||
{
|
||||
$networks = null;
|
||||
if($this->model && (
|
||||
isset($this->model->ipaddress->module_host_id) ||
|
||||
isset($this->model->module_host_id)
|
||||
))
|
||||
{
|
||||
$networks = $this->networkRepository->filter(
|
||||
[
|
||||
'module_host_id' => $this->model->ipaddress->module_host_id ?? $this->model->module_host_id
|
||||
],
|
||||
[],
|
||||
[],
|
||||
['id', 'name']
|
||||
);
|
||||
}
|
||||
return view('components.module.network',compact('networks'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user