Skip to content
View as Markdown

Helper Classes

FluentCRM provides several service classes that you can use to build advanced functionalities in your plugin or addon. These classes are used extensively by FluentCRM itself and are available for third-party developers.

CRM Service Classes

ClassNamespaceDescription
HelperFluentCrm\App\Services\HelperCore utility class with 50+ static methods for contacts, emails, settings, SmartCodes, and more
SanitizeFluentCrm\App\Services\SanitizeData sanitization for contacts, campaigns, funnels, companies, and taxonomy IDs
PermissionManagerFluentCrm\App\Services\PermissionManagerManage FluentCRM capabilities — check, assign, and list user permissions
ParserFluentCrm\App\Services\Libs\Parser\ParserSmartCode template parser — replace dynamic placeholders in email templates
ContactsQueryFluentCrm\App\Services\ContactsQueryAdvanced contact querying with filtering, sorting, and pagination

Framework Classes

ClassNamespaceDescription
RequestFluentCrm\Framework\Http\Request\RequestHTTP request handling — input retrieval, type-safe accessors, validation, file uploads
ArrFluentCrm\Framework\Support\Arr80+ static array utility methods — get, set, dot notation, filtering, sorting, pattern matching
StrFluentCrm\Framework\Support\StrString utility methods — contains, startsWith, slug, camel, snake, and more

Usage

All service classes can be used directly via their fully-qualified namespace:

php
use FluentCrm\App\Services\Helper;
use FluentCrm\App\Services\Sanitize;
use FluentCrm\App\Services\PermissionManager;
use FluentCrm\App\Services\Libs\Parser\Parser;
use FluentCrm\App\Services\ContactsQuery;

// Example: Check if a feature is enabled
$isCompanyEnabled = Helper::isCompanyEnabled();

// Example: Sanitize contact data before saving
$cleanData = Sanitize::contact($requestData);

// Example: Check current user permissions
$canManage = PermissionManager::currentUserCan('fcrm_manage_contacts');