Download the PHP package remp/crm-family-module without Composer

On this page you can find all versions of the php package remp/crm-family-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package crm-family-module

CRM Family Module

Translation status @ Weblate

Family module is an extension to Subscriptions module providing parent/child relation between subscriptions. Parent subscription is able to trigger generation of child subscriptions via family_requests.

WARNING: Module is close-to-production quality, but expect some major breaking changes in the future (e.g. dropping of redundant tables, changing master/slave names).

Installation

Add remp/crm-family-module via repository or package to your composer.json file and install it to your CRM skeleton.

Enable installed extension in your app/config/config.neon file:

Usage

Family module needs to know which subscription types are meant to be parents and what subscription types should the child subscriptions have.

To do that, please seed the relations via FamilySubscriptionTypesRepository::add() method:

Anytime new master subscription is created, handler will create requests with codes that can be shared with other users so they can activate their access.

These codes can be accessed via two channels:

ExtendFamilyExtension

You can use ExtendFamilyExtension subscription type extension method to extend your family/company subscriptions.

If CRM is creating new subscription with subscription type with this extension method, it tries to find all actual family subscriptions. If there is one, new subscription is appended after the actual. Otherwise the new subscription starts immediately (ignoring other non-family subscriptions).

The extension is registered automatically. If FamilyModule is enabled, you should be able to select it in your subscription type form.

Renewal of child subscriptions

If the parent user account renews family/company subscription and new subscription starts at the same time as the previous one ends, child accounts are given new (renewed) subscriptions too. It's done automatically by event handler \Crm\FamilyModule\Events\NewSubscriptionHandler.

This time gap between subscriptions can be configured within your main config. For example if you want to allow renewal only 7 days after end of the subscription:

You can also prevent copying activated family requests at all, by adding meta keep_requests_unactivated=1 to payment meta table.

Dynamic count of child subscriptions

If you don't want to have static count of generated child subscriptions defined within family_subscription_types.count, you can set your family subscription's value count to 0 and define number of child subscriptions to generate within payment item count. Conditions:

Example of payment item set while creating payment from within admin interface:

In this case, handler \Crm\FamilyModule\Events\NewSubscriptionHandler generates 7 child subscriptions.

Custom type and count of child subscriptions

If you want to have opportunity to define own combination of subscription types and their count you can do it by creating customizable subscription type with following steps:

Admin interface in case of customizable subscription types is selected handles differently - display additional options for subscription type count and price.

Example of creating the payment of family subscription with customizable subscription type:

By the creating of payment for family subscriptions the payment items are created according counts and prices entered in admin form. In this case, handler \Crm\FamilyModule\Events\NewSubscriptionHandler generates 6 child subscriptions (5 of WEB type and 1 of KLUB type).

API documentation

All examples use http://crm.press as a base domain. Please change the host to the one you use before executing the examples.

All examples use XXX as a default value for authorization token, please replace it with the real tokens:

API responses can contain following HTTP codes:

Value Description
200 OK Successful response, default value
400 Bad Request Invalid request (missing required parameters)
403 Forbidden The authorization failed (provided token was not valid)
404 Not found Referenced resource wasn't found

If possible, the response includes application/json encoded payload with message explaining the error further.


GET /api/v1/family/list

Lists all available family codes of parent's account to share.

Headers:
Name Value Required Description
Authorization Bearer String yes User token of parent account.
Example:

Response:


POST /api/v1/family/activate

Activates provided family code and creates child subscription on the authenticated account.

Headers:
Name Value Required Description
Authorization Bearer String yes User token of child account.
Payload
Example:

Response:

Work in progress...

Fixed days child subscriptions. Sometimes you might want to allow your users to generate child subscriptions independent of the master subscription that will last fixed amount of days. We plan to work on the implementation allowing to specify this in the family_subscription_types.

Dynamic count of child subscriptions. This will allow the ability to use single parent-child relation to generate dynamic number of child subscriptions based on a setting of parent subscription.


All versions of crm-family-module with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package remp/crm-family-module contains the following files

Loading the files please wait ....