34 lines
819 B
PHP
34 lines
819 B
PHP
<?php
|
|
|
|
namespace App\Models\Equipment\Part;
|
|
|
|
use App\Models\Equipment\EquipmentModel;
|
|
|
|
abstract class PartModel extends EquipmentModel
|
|
{
|
|
protected $allowedFields = [
|
|
"model",
|
|
"status",
|
|
"updated_at"
|
|
];
|
|
protected function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
final public function getFieldRule(string $action, string $field): string
|
|
{
|
|
if (is_array($field)) {
|
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
|
}
|
|
switch ($field) {
|
|
case "model":
|
|
$rule = "required|trim|string";
|
|
break;
|
|
default:
|
|
$rule = parent::getFieldRule($action, $field);
|
|
break;
|
|
}
|
|
return $rule;
|
|
}
|
|
}
|