Laravel integration for the Bitrix24 REST API with CRM entity helpers.
doniyor/bitrix24-laravel is a Laravel package for laravel integration for the bitrix24 rest api with crm entity helpers..
It currently has 0 GitHub stars and 7 downloads on Packagist (latest version 4.0).
Install it with composer require doniyor/bitrix24-laravel.
Discover more Laravel packages by doniyor
or browse all Laravel packages to compare alternatives.
Last updated
Laravel wrapper around the Bitrix24 REST API with a focus on CRM entities.
composer require doniyor/bitrix24-laravel
Publish configuration:
php artisan vendor:publish --tag=bitrix24-config
Configure the following environment variables:
BITRIX24_BASE_URI="https://your-domain.bitrix24.com/rest/"
BITRIX24_WEBHOOK_USER=1
BITRIX24_WEBHOOK_CODE=abcdefghijklmno
# Optional when using OAuth:
# BITRIX24_AUTH_TOKEN="oauth_access_token"
BITRIX24_BASE_URI, BITRIX24_WEBHOOK_USER, and BITRIX24_WEBHOOK_CODE. Requests are routed to {base}/{user}/{code}/{method}.json automatically. Leave the auth token unset.BITRIX24_AUTH_TOKEN. The client sends the token as the auth query parameter.If both webhook credentials and an auth token are present, the webhook path takes precedence.
Access the manager with dependency injection:
use Doniyor\Bitrix24\Bitrix24Manager;
use Doniyor\Bitrix24\DTO\CRM\LeadFieldsDto;
public function __construct(private Bitrix24Manager $bitrix) {}
public function createLead(): int
{
return $this->bitrix->crm()->leads()->add(
new LeadFieldsDto(
title: 'New lead',
name: 'Jane',
lastName: 'Doe',
phones: [
['VALUE' => '+123456789', 'VALUE_TYPE' => 'WORK'],
],
emails: [
['VALUE' => '[email protected]', 'VALUE_TYPE' => 'WORK'],
],
)
);
}
Or via the facade:
use Doniyor\Bitrix24\Facades\Bitrix24;
use Doniyor\Bitrix24\DTO\CRM\LeadFieldsDto;
$lead = Bitrix24::crm()->leads()->get(42);
Bitrix24::crm()->leads()->update(
42,
(new LeadFieldsDto(title: 'Existing lead'))
->withExtra(['STATUS_ID' => 'CONVERTED'])
);
For other CRM entities, use Bitrix24::crm()->service('entityName').
add and update operations expect an implementation of Doniyor\Bitrix24\DTO\FieldsDtoInterface.Doniyor\Bitrix24\DTO\CRM\LeadFieldsDtoDoniyor\Bitrix24\DTO\CRM\DealFieldsDtoDoniyor\Bitrix24\DTO\CRM\ContactFieldsDtoDoniyor\Bitrix24\DTO\CRM\CompanyFieldsDtoDoniyor\Bitrix24\DTO\CRM\ProductFieldsDtoDoniyor\Bitrix24\DTO\CRM\ProductSectionFieldsDtoDoniyor\Bitrix24\DTO\CRM\QuoteFieldsDtoDoniyor\Bitrix24\DTO\CRM\InvoiceFieldsDtoDoniyor\Bitrix24\DTO\CRM\ActivityFieldsDtoDoniyor\Bitrix24\DTO\CRM\RequisiteFieldsDtoDoniyor\Bitrix24\DTO\CRM\DealCategoryFieldsDtoDoniyor\Bitrix24\DTO\CRM\StatusFieldsDtoDoniyor\Bitrix24\DTO\CRM\StageFieldsDtoDoniyor\Bitrix24\DTO\CRM\CurrencyFieldsDtoDoniyor\Bitrix24\DTO\GenericFieldsDto for quick array-backed payloads.Doniyor\Bitrix24\CRM\Mappers\LeadResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\LeadDataDoniyor\Bitrix24\CRM\Mappers\DealResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\DealDataDoniyor\Bitrix24\CRM\Mappers\ContactResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\ContactDataDoniyor\Bitrix24\CRM\Mappers\CompanyResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\CompanyDataDoniyor\Bitrix24\CRM\Mappers\ProductResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\ProductDataDoniyor\Bitrix24\CRM\Mappers\ProductSectionResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\ProductSectionDataDoniyor\Bitrix24\CRM\Mappers\QuoteResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\QuoteDataDoniyor\Bitrix24\CRM\Mappers\InvoiceResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\InvoiceDataDoniyor\Bitrix24\CRM\Mappers\ActivityResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\ActivityDataDoniyor\Bitrix24\CRM\Mappers\RequisiteResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\RequisiteDataDoniyor\Bitrix24\CRM\Mappers\DealCategoryResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\DealCategoryDataDoniyor\Bitrix24\CRM\Mappers\StatusResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\StatusDataDoniyor\Bitrix24\CRM\Mappers\StageResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\StageDataDoniyor\Bitrix24\CRM\Mappers\CurrencyResponseMapper → Doniyor\Bitrix24\DTO\CRM\Response\CurrencyDatause Doniyor\Bitrix24\Facades\Bitrix24;
use Doniyor\Bitrix24\CRM\Mappers\LeadResponseMapper;
$payload = Bitrix24::crm()->leads()->get(42);
$lead = app(LeadResponseMapper::class)->map($payload);
echo $lead->title;