src/Label305/AujaLaravel/Factory/MultipleAssociationsIndexMenuFactory.php
public function create($modelName, $modelId, array $relations, ModelConfig $config = null) {
        $menu = new Menu();

        $addMenuItem = new LinkMenuItem();
        $addMenuItem->setText(Lang::trans('Edit'));
        $addMenuItem->setTarget(URL::route($this->aujaRouter->getEditName($modelName), $modelId));
        $menu->addMenuItem($addMenuItem);

        $spacerMenuItem = new SpacerMenuItem();
        $spacerMenuItem->setText(Lang::trans('Properties'));
        $menu->addMenuItem($spacerMenuItem);

        foreach ($relations as $relation) {
            $otherModelName = $relation->getRight()->getName();

            $associationMenuItem = new LinkMenuItem();
            $associationMenuItem->setText(Lang::trans(str_plural($otherModelName)));
            $associationMenuItem->setTarget(URL::route($this->aujaRouter->getAssociationMenuName($modelName, $otherModelName), $modelId));
            $menu->addMenuItem($associationMenuItem);
        }

        return $menu;
    }
public function create($modelName, $modelId, array $relations, ModelConfig $config = null) {
        $menu = new Menu();

        $addMenuItem = new LinkMenuItem();
        $addMenuItem->setText(Lang::trans('Edit'));
        $addMenuItem->setTarget(URL::route($this->aujaRouter->getEditName($modelName), $modelId));
        $menu->addMenuItem($addMenuItem);

        $spacerMenuItem = new SpacerMenuItem();
        $spacerMenuItem->setText(Lang::trans('Properties'));
        $menu->addMenuItem($spacerMenuItem);

        foreach ($relations as $relation) {
            $otherModelName = $relation->getRight()->getName();

            $associationMenuItem = new LinkMenuItem();
            $associationMenuItem->setText(Lang::trans(str_plural($otherModelName)));
            $associationMenuItem->setTarget(URL::route($this->aujaRouter->getAssociationMenuName($modelName, $otherModelName), $modelId));
            $menu->addMenuItem($associationMenuItem);
        }

        return $menu;
    }
Builds a menu for a single model entry, where the model has multiple relationships with other models.

The menu will include:
- An Edit LinkMenuItem;
- A SpacerMenuItem;
- For each of the Relations, a LinkMenuItem for the associated model.

@param String     $modelName the name of the model.
@param int        $modelId   the id of the model entry.
@param Relation[] $relations the Relations this model has with associated models.

@return Menu the Menu, which can be configured further.