示例#1
0
 public function remove(Employee $employee, Project $project)
 {
     if (!$employee->inProject($project)) {
         return false;
     }
     $employee->projects()->detach($project);
     return true;
 }
示例#2
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function add(EmployeeRequest $request)
 {
     $employee = new Employee($request->all());
     $employee->status = true;
     $employee->save();
     $email = $request->get('email');
     $success = $this->employeeRepository->addEmail($employee, $email);
     if ($request->ajax()) {
         return response()->json(compact('success', 'employee'));
     }
     exit;
 }
示例#3
0
 public function delPhone(Employee $employee, $id)
 {
     return $employee->phones()->find($id)->delete();
 }