protected function getRelationName()
    {
        $relation = array_get($this->actionData->options(), 'relation');

        if ($relation) {
            return $relation;
        }

        /** @var ModelInformationRepositoryInterface $infoRepository */
        $infoRepository = app(ModelInformationRepositoryInterface::class);

        $info = $infoRepository->getByModelClass($this->otherModelClass);

        if ( ! $info || empty($info->list->parents) || count($info->list->parents) !== 1) {
            return false;
        }

        return head($info->list->parents)->relation;
    }
protected function getRelationName()
    {
        $relation = array_get($this->actionData->options(), 'relation');

        if ($relation) {
            return $relation;
        }

        /** @var ModelInformationRepositoryInterface $infoRepository */
        $infoRepository = app(ModelInformationRepositoryInterface::class);

        $info = $infoRepository->getByModelClass($this->otherModelClass);

        if ( ! $info || empty($info->list->parents) || count($info->list->parents) !== 1) {
            return false;
        }

        return head($info->list->parents)->relation;
    }
protected function getRelationName ( ) { $ relation = array_get ( $ this -> actionData -> options ( ) , 'relation' ) ; if ( $ relation ) { return $ relation ; } /** @var ModelInformationRepositoryInterface $infoRepository */ $ infoRepository = app ( ModelInformationRepositoryInterface :: class ) ; $ info = $ infoRepository -> getByModelClass ( $ this -> otherModelClass ) ; if ( ! $ info || empty ( $ info -> list -> parents ) || count ( $ info -> list -> parents ) !== 1 ) { return false ; } return head ( $ info -> list -> parents ) -> relation ; }
Returns configured relation name for children link.

Falls back to list.parents relation name if exactly one given.

@return string|false
Returns configured relation name for children link .