mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-20 21:04:21 +00:00
contract template obligation api
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Http\Rules\User;
|
||||
|
||||
use Auth;
|
||||
use App\Models\ContractTemplate;
|
||||
use App\Models\ContractTemplateObligation;
|
||||
|
||||
use App\Http\Helpers\Hasher;
|
||||
|
||||
@@ -50,6 +51,20 @@ class ExistCheck implements Rule
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->type == 'contract_template_obligation') {
|
||||
foreach ($value as $key => $row) {
|
||||
if(!empty($row)) {
|
||||
$id = Hasher::decode('contract_template_obligations', $row);
|
||||
$data = ContractTemplateObligation::
|
||||
where('id', $id)
|
||||
->count();
|
||||
if (!$data) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user