PHPackages                             sergeybruhin/laravel-nano-crm - 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. [API Development](/categories/api)
4. /
5. sergeybruhin/laravel-nano-crm

ActiveLibrary[API Development](/categories/api)

sergeybruhin/laravel-nano-crm
=============================

Laravel integration package for nano-crm-api

v0.0.1(1mo ago)05MITPHPPHP ^8.3

Since May 26Pushed 1mo agoCompare

[ Source](https://github.com/sergeybruhin/laravel-nano-crm)[ Packagist](https://packagist.org/packages/sergeybruhin/laravel-nano-crm)[ RSS](/packages/sergeybruhin-laravel-nano-crm/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

laravel-nano-crm
================

[](#laravel-nano-crm)

Laravel integration package for [nano-crm-api](https://github.com/sergeybruhin/nano-crm-api) — wraps [nano-crm-client](https://github.com/sergeybruhin/nano-crm-client) with a service container singleton, a facade, and queue jobs for asynchronous lead and contact submission to a self-hosted Nano CRM API.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 11, 12, or 13

Installation
------------

[](#installation)

```
composer require sergeybruhin/laravel-nano-crm
```

The service provider and `NanoCrm` facade alias are registered automatically via package discovery.

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=nano-crm-config
```

This creates `config/nano-crm.php`. Set the following environment variables:

VariableDefaultDescription`NANO_CRM_BASE_URL``http://nano-crm-api`Base URL of the nano-crm-api service`NANO_CRM_SERVICE_TOKEN`—M2M Bearer token (required)`NANO_CRM_TIMEOUT``10`HTTP request timeout in seconds`NANO_CRM_QUEUE``default`Queue used by the async jobsOn a Docker internal network the base URL is typically the container hostname, e.g. `http://nano-crm-api`.

Usage
-----

[](#usage)

### Facade

[](#facade)

```
use NanoCrm\Laravel\Facades\NanoCrm;
use NanoCrm\Client\Dto\CreateLeadInput;

$lead = NanoCrm::leads()->create(new CreateLeadInput(
    contact: ['full_name' => 'Ivan Petrov', 'phone' => '+79001234567'],
    source:  'example.com',
    type:    'callback',
));
```

### Dependency injection

[](#dependency-injection)

```
use NanoCrm\Laravel\NanoCrmManager;
use NanoCrm\Client\Dto\CreateContactInput;

class MyService
{
    public function __construct(private NanoCrmManager $crm) {}

    public function sync(): void
    {
        $contact = $this->crm->contacts()->create(new CreateContactInput(
            fullName:           'Ivan Petrov',
            primaryPhoneNumber: '+79001234567',
        ));
    }
}
```

### Queue jobs

[](#queue-jobs)

Dispatch jobs to submit leads or contacts asynchronously. They use the queue configured in `NANO_CRM_QUEUE` and retry up to 3 times with a 10 s backoff.

```
use NanoCrm\Laravel\Jobs\SendLeadToNanoCrm;
use NanoCrm\Laravel\Jobs\SendContactToNanoCrm;
use NanoCrm\Client\Dto\CreateLeadInput;
use NanoCrm\Client\Dto\CreateContactInput;

// Dispatch a lead (fire and forget)
SendLeadToNanoCrm::dispatch(new CreateLeadInput(
    contact: ['full_name' => 'Ivan Petrov', 'phone' => '+79001234567'],
    source:  'example.com',
    type:    'callback',
));

// Dispatch with a success callback
SendLeadToNanoCrm::dispatch(
    new CreateLeadInput(...),
    onSuccessCallback: fn (LeadDto $lead) => Cache::put("lead:{$lead->uuid}", $lead),
);

// Dispatch a contact
SendContactToNanoCrm::dispatch(new CreateContactInput(
    fullName:           'Ivan Petrov',
    primaryPhoneNumber: '+79001234567',
));
```

Both jobs are tagged `['nano-crm', 'lead']` / `['nano-crm', 'contact']` for Horizon visibility.

Artisan command
---------------

[](#artisan-command)

```
php artisan nano-crm:ping
```

Checks that the service is reachable and the token is valid. A 404 response from the API counts as success (the service is up and authenticated). Useful for container readiness checks.

Testing
-------

[](#testing)

Swap the underlying HTTP client in tests using `setClient()`:

```
use GuzzleHttp\Client;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response;
use NanoCrm\Client\NanoCrmClient;
use NanoCrm\Laravel\NanoCrmManager;

$mock = new MockHandler([
    new Response(201, [], json_encode([
        'uuid'       => '019602a0-0000-7000-8000-000000000001',
        'type'       => 'callback',
        'source'     => 'example.com',
        'is_test'    => false,
        'sent_at'    => '2024-01-01T00:00:00+00:00',
        'created_at' => '2024-01-01T00:00:00+00:00',
        'updated_at' => '2024-01-01T00:00:00+00:00',
        'contact'    => null,
        'utm'        => null,
        'remote_ids' => null,
        'form'       => null,
        'meta'       => null,
        'form_key'   => null,
    ])),
]);

$http    = new Client(['handler' => HandlerStack::create($mock)]);
$client  = new NanoCrmClient($http);

$manager = app(NanoCrmManager::class);
$manager->setClient($client);

$lead = $manager->leads()->create(...);
```

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance88

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

59d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/08a6c60ed6a4cdd9dc4104bac89bd503265c085b15e530eb8616cc78b01db33c?d=identicon)[SergeyBruhin](/maintainers/SergeyBruhin)

---

Top Contributors

[![sergeybruhin](https://avatars.githubusercontent.com/u/8505172?v=4)](https://github.com/sergeybruhin "sergeybruhin (1 commits)")

### Embed Badge

![Health badge](/badges/sergeybruhin-laravel-nano-crm/health.svg)

```
[![Health](https://phpackages.com/badges/sergeybruhin-laravel-nano-crm/health.svg)](https://phpackages.com/packages/sergeybruhin-laravel-nano-crm)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M136](/packages/laravel-pulse)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M246](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

728176.2k14](/packages/tallstackui-tallstackui)[flarum/core

Delightfully simple forum software.

211.4M2.4k](/packages/flarum-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
