code: public function menuFor($model, $modelId = 0, ModelConfig $config = null) {
          if (is_null($this->aujaConfigurator)) {
              throw new \LogicException('Auja not initialized. Call Auja::init first.');
          }
  
          $modelName = $this->resolveModelName($model);
  
          if ($modelId == 0) {
              $menu = $this->noAssociationsMenuFor($modelName, $config);
          } else {
              $menu = $this->buildComplexIndexMenu($modelName, $modelId, $config);
          }
  
          return $menu;
      }
docs: Intelligently creates an index menu for given model, and optionally model id.
  
  @param Controller|Eloquent|String $model   An object which represents the model to build the menu for.
  @param int                        $modelId (optional) The id of an instance of the model.
  @param ModelConfig                $config  (optional) The `ModelConfig` to use.
  
  @return Menu The built `Menu` instance, which can be configured further.