← Blog
Perfex CRMPerfex CRM NextLaravel

Selling and Updating Your Own Perfex CRM Next Modules

perfexcrm.com does not sell third-party modules. Host three endpoints - releases, verify and download - and customers update your module from inside their CRM.

perfexcrm.com does not sell third-party modules. If you build for Perfex CRM Next, you sell it yourself and you host the update API yourself. Three endpoints, one JSON block in module.json, and customers update from inside their CRM exactly as they do for first-party modules.

This is the plumbing, written out, because the documentation covers it in one page and the failure modes are not obvious until a customer hits one.

We sell Perfex modules and run this stack ourselves, so treat it as a vendor describing their own setup rather than as impartial advice.

What the vendor permits

Selling modules on perfexcrm.com is not open to module developers. To sell a module, use your own licensing API.

Modules you build are your own code. You can sell or distribute them yourself, for example on your own website or CodeCanyon, as long as they do not include Perfex CRM’s own code.

Clear enough. Your module, your channel, your licensing. What you may not do is ship Perfex’s own code inside it.

The module.json block

{
  "version": "2.0.1",
  "updates": {
    "url": "https://vendor.example.com/api/{alias}",
    "headers": { "X-Api-Key": "{env:MY_MODULE_API_KEY}" },
    "timeout": 15,
    "license_key_label": "License key",
    "license_key_help": "Find your key in the vendor portal after purchase.",
    "license_key_help_url": "https://vendor.example.com/account/licenses"
  }
}
KeyNotes
urlHTTPS only - a plain HTTP URL is ignored silently. May contain {slug}, {alias}, {name}, {version}
headersOptional. A value of exactly {env:VAR_NAME} is read from the customer’s environment; while that variable is empty the whole url is ignored
timeout1 to 30 seconds, 15 by default
license_key_label, license_key_help, license_key_help_urlText and an HTTPS link beside the licence key field

That {env:...} behaviour is the first trap. If you use an env-based header and the customer has not set the variable, updates do not fail loudly - the URL is ignored and your module simply never offers an update. Only use it for keys you actually expect the customer to have.

The three endpoints

EndpointPurposeLicence key
GET {url}/releasesThe releases, as JSONNot sent
GET {url}/verifyLicence validationBearer token
GET {url}/download?version=The release ZIPBearer token

Every request carries query parameters describing the installation: installed_version, crm_version, php_version, app_url, locale. That php_version field is worth watching, because Next requires PHP 8.4 and your own module constraint has to live above whatever your customers actually run. That is a free install-base telemetry feed - which PHP versions your customers really run, which CRM versions you still have to support - and it arrives whether you log it or not.

releases

[
  { "version": "2.1.0", "released_at": "2026-11-01T09:00:00+00:00", "requires_at_least": "1.3.0" },
  { "version": "2.0.1", "released_at": "2026-10-12T09:00:00+00:00" }
]

Perfex offers the newest release whose requires_at_least the installation satisfies, and caches the answer for 10 minutes. released_at and requires_at_least are optional; a plain array of version strings is valid.

requires_at_least is how you avoid your own support tickets. Set it on every release that needs a newer CRM, and an older installation is quietly offered the last version it can actually run instead of one that breaks on upgrade.

verify

{ "valid": true, "active": true, "supported_until": "2027-01-01T00:00:00+00:00" }

valid means the key is recognised. active means updates are allowed - false shows a support-expired error. supported_until is optional and shown in the update dialog, which is a quietly effective renewal prompt.

download

Returns the ZIP for the requested version. Same layout and same validation as a manual upload.

Status codes, and why they matter

Return these and the update dialog shows the right message. Return 400 for everything and your customers see a generic failure and email you instead.

CodeMeaning
497Empty licence key
498Invalid licence key
493Support or update window expired
496Requested release does not exist
491Installation not covered by the licence
495Server PHP below the module’s requirement

A JSON message in the response replaces the default text, which is where you put something actionable: a renewal link for 493, a note about which installation holds the seat for 491.

Packaging

php artisan module:build MyFeature --with-vendor --force

Builds frontend assets, runs the package checks and writes MyFeature-1.2.0.zip. The archive holds one top-level folder named after the module, with module.json directly inside it.

Excluded automatically: .git, node_modules, tests, .idea, .vscode, storage, .phpunit.cache, .env and .env.*, vendor/bin, plus hot, phpunit.xml* and *.log anywhere. When the module folder is its own git repository, files its .gitignore ignores are excluded too - so a stray database dump or key file never ships. public/build/ and vendor/ stay in regardless, because they are the built output and the dependencies.

The replace block

Add this to the module’s composer.json before adding any Composer dependency:

"replace": {
    "laravel/framework": "*",
    "illuminate/support": "*",
    "illuminate/database": "*",
    "illuminate/events": "*",
    "illuminate/http": "*",
    "illuminate/contracts": "*",
    "illuminate/container": "*",
    "illuminate/filesystem": "*",
    "illuminate/console": "*",
    "illuminate/view": "*",
    "illuminate/validation": "*",
    "illuminate/bus": "*",
    "illuminate/cache": "*",
    "illuminate/config": "*",
    "illuminate/collections": "*",
    "livewire/livewire": "*"
}

After composer install --no-dev, your vendor/ must contain only the third-party packages you actually add - no laravel/, no illuminate/, no livewire/. With no dependencies at all, omit vendor/ entirely.

Validation on upload, enable and update checks: requires_at_least against the CRM version, your php constraint, your ext-* requirements, the presence of vendor/autoload.php when needed, package conflicts with the application and with other installed modules, and PSR-4 namespace collisions. That middle one is the awkward case: if two vendors ship the same Composer package in their vendor/, one of you has to drop it, which means a conversation with a competitor.

Bug reports, which you should turn on

"bug_reports": {
    "url": "https://bugs.example.com/api/perfex",
    "headers": { "X-Api-Key": "{env:MY_MODULE_BUG_REPORT_TOKEN}" },
    "timeout": 15
}

Your module then appears in the CRM’s own bug-report form and reports POST to you as JSON: the description, the page they were on, the browser, your module’s alias and version, system info including PHP version, DB driver, memory limit and queue connection, queue and mail health, and recent errors raised in your module’s files with message, file, line and trace.

Other installed modules, the licence key and the identification key are never sent.

Add your own state with diagnostics() in the module definition:

$module->diagnostics(fn (): array => [
    'Failed deliveries' => Delivery::query()->failed()->count(),
]);

Up to 50 label-value pairs of counts, states and dates. Never secrets, addresses or customer data - this leaves the customer’s installation and lands in your inbox.

The part nobody builds until it hurts

Your licensing API is now a dependency of every customer’s update flow. Three practical notes:

Cache releases yourself. It is called by every installation and needs no key. Perfex caches for 10 minutes on its side; serve it from a static file or a CDN edge and it costs nothing.

Make verify cheap and generous. It runs on every update check. A slow or flaky verify endpoint turns into “your module says my licence is invalid” tickets, and the customer is not wrong to blame you.

Keep old releases downloadable. requires_at_least only helps if the older ZIP is still served. Customers on an older CRM need the version that matches, and 496 for a release you deleted is a support ticket you created.

If you are writing your first one

Start with how a Next module is actually built - the definition class, the builder API and the extension points. Then check which module categories Next absorbed before you pick what to build, because a good few Classic module categories are now core features and no longer products.

And if your module stores data that Classic users will want to bring with them, we are building a migration registry other vendors can plug into - a published contract so your Classic tables can be imported into Next alongside everyone else’s. Tell us what you are building and we will send you the interface.

Common questions

Can I sell my module on perfexcrm.com?

No. Selling modules on perfexcrm.com is not open to module developers. Modules you build are your own code and you can sell them yourself, from your own site or a marketplace, as long as they do not include Perfex CRM's own code.

How do customers update a third-party Perfex CRM Next module?

From Settings, System, Modules, against your own HTTPS licensing API. Point updates.url in module.json at it and the CRM offers the newest release your API reports, checking the licence key as a bearer token.

What endpoints does a Perfex CRM Next module licensing API need?

Three under one base URL: GET /releases returns the versions as JSON and sends no licence key, GET /verify validates the key, and GET /download?version= returns the release ZIP. The last two receive the licence key as a bearer token.

Which HTTP status codes should a Perfex module licensing API return?

497 empty licence key, 498 invalid key, 493 support or update window expired, 496 requested release does not exist, 491 installation not covered by the licence, 495 server PHP below the module requirement. A JSON message field replaces the default text.

How do I build a release ZIP for a Perfex CRM Next module?

php artisan module:build MyModule --with-vendor --force. It builds frontend assets, runs the packaging checks and writes {Name}-{version}.zip containing one top-level folder with module.json inside it. Add the replace block to composer.json first or validation rejects the upload.