PHPackages                             remp/crm-segment-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. remp/crm-segment-module

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

remp/crm-segment-module
=======================

CRM Segment Module

4.4.0(5mo ago)045.3k—7.1%41MITPHPPHP ^8.1

Since Oct 22Pushed 5mo ago5 watchersCompare

[ Source](https://github.com/remp2020/crm-segment-module)[ Packagist](https://packagist.org/packages/remp/crm-segment-module)[ Docs](https://remp2030.com)[ RSS](/packages/remp-crm-segment-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (85)Used By (1)

CRM Segment Module
==================

[](#crm-segment-module)

[![Translation status @ Weblate](https://camo.githubusercontent.com/c6e5551e0cb98b789c863b71f4e83630c8472b4fe6104adb6f168d4eb157d07b/68747470733a2f2f686f737465642e7765626c6174652e6f72672f776964676574732f72656d702d63726d2f2d2f7365676d656e742d6d6f64756c652f7376672d62616467652e737667)](https://hosted.weblate.org/projects/remp-crm/segments-module/)

Segment recalculation
---------------------

[](#segment-recalculation)

Default segment recalculation times:

periodicitydefault recalculation timeminutesasaphoursat 30. minute of configured hourdaysat 4:00 hour of configured dayYou can configure default segment recalculation times by adding these setup method calls to your configuration file:

```
segmentRecalculationConfig:
    setup:
    	# sets time of the day when segments with daily periodicity are recalculated
        - setDailyRecalculationTime('4:00')
        # sets minute of the hour in which segments with hourly periodicity are recalculated
        - setHourlyRecalculationMinute('30')
```

### Segment nesting

[](#segment-nesting)

Segment nesting is a feature, that adds ability to use one segment in other segment definition.

This feature is disabled by default, since it's only supported by our default implementation of `SegmentInterface`. To enable it, add this to your neon configuration:

```
segments:
    segment_nesting: true
```

After enabling, new `SegmentCriteria` criteria is registered and available to use in visual Segments editor.

#### Segments editor v1

[](#segments-editor-v1)

The feature is also available in segments text editor. To reference other segment in a segment query, use the code `%segment.ACTUAL_SEGMENT_CODE%`.

For example, let's have a segment `segment_a` specified by the query:

```
SELECT users.id, users.email FROM users WHERE id > 100 AND id
