/**
  * @param Field $field
  * @param ContextContract $context
  * @return bool
  */
 private function isWritable(Field $field, Context $context)
 {
     return $field->shouldInclude($context, $this->currentPath);
 }
 /**
  * @param Context $context
  * @param CurrentPath $currentPath
  * @return bool
  */
 public function shouldInclude(Context $context, CurrentPath $currentPath)
 {
     // Check for max depth.
     if ($maxDepth = $this->getMaxDepth()) {
         $existing = $currentPath->countSame($this);
         if ($existing > $maxDepth) {
             return false;
         }
     }
     return parent::shouldInclude($context, $currentPath);
 }