public function remove(Employee $employee, Project $project) { if (!$employee->inProject($project)) { return false; } $employee->projects()->detach($project); return true; }
/** * 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; }
public function delPhone(Employee $employee, $id) { return $employee->phones()->find($id)->delete(); }