Esempio n. 1
0
 /**
  * boot
  *
  */
 public static function boot()
 {
     parent::boot();
     ContractElement::observe(new ContractElementObserver());
 }
 /**
  * Delete a ContractElement
  *
  * @return Response
  */
 public function delete($org_id = null, $id = null)
 {
     //
     $contract_element = \App\ThunderID\EmploymentSystemV1\Models\ContractElement::id($id)->organisationid($org_id)->first();
     if (!$contract_element) {
         return new JSend('error', (array) Input::all(), 'Contract Element tidak ditemukan.');
     }
     $result = $contract_element->toArray();
     if ($contract_element->delete()) {
         return new JSend('success', (array) $result);
     }
     return new JSend('error', (array) $result, $contract_element->getError());
 }