canDo('employee.leave.approve')) { return true; } return false; } /** * Determine if the given user can approve the given leave. * * @param Authenticatable $user * * @return bool */ public function submit(Authenticatable $user, Leave $leave) { if ($user->canDo('employee.leave.submit')) { return true; } return false; } /** * Determine if the given user can approve the given leave. * * @param Authenticatable $user * * @return bool */ public function publish(Authenticatable $user, Leave $leave) { if ($user->canDo('employee.leave.publish')) { return true; } return false; } /** * Determine if the given user can approve the given leave. * * @param Authenticatable $user * * @return bool */ public function unpublish(Authenticatable $user, Leave $leave) { if ($user->canDo('employee.leave.unpublish')) { return true; } return false; } /** * Determine if the given user can approve the given leave. * * @param Authenticatable $user * * @return bool */ public function archive(Authenticatable $user, Leave $leave) { if ($user->canDo('employee.leave.archive')) { return true; } return false; } /** * Determine if the given user can approve the given leave. * * @param Authenticatable $user * * @return bool */ public function unarchive(Authenticatable $user, Leave $leave) { if ($user->canDo('employee.leave.unarchive')) { return true; } return false; } /** * Determine if the given user can approve the given leave. * * @param Authenticatable $user * * @return bool */ public function reject(Authenticatable $user, Leave $leave) { if ($user->canDo('employee.leave.reject')) { return true; } return false; } }