vhost/app/Cells/ProductCell.php
2024-05-20 17:25:35 +09:00

39 lines
1023 B
PHP

<?php
namespace App\Cells;
use App\Cells\BaseCell;
use App\Models\DeviceModel;
class ProductCell extends BaseCell
{
private $_deviceModel = null;
final protected function getDeviceModel(): DeviceModel
{
return $this->_deviceModel = $this->_deviceModel ?: new DeviceModel();
}
public function device(array $cellDatas = [])
{
$cellDatas['device'] = [];
$cellDatas['device']['categorys'] = ['server', 'cpu', 'memory', 'disk', 'nic', 'publicip', 'os'];
$cellDatas['device']['options'] = $this->getDeviceModel()->getOptions();
return view(
'Views/cells/product/' . __FUNCTION__,
['cellDatas' => $cellDatas]
);
}
public function device_calulator(array $cellDatas = []): string
{
$cellDatas['device'] = [];
$cellDatas['device']['categorys'] = ['server', 'cpu', 'memory', 'disk', 'nic', 'publicip', 'os'];
$cellDatas['device']['options'] = $this->getDeviceModel()->getOptions();
return view(
'Views/cells/product/' . __FUNCTION__,
['cellDatas' => $cellDatas]
);
}
}