centrex / laravel-crm
Core CRM package for companies, contacts, leads, deals, activities, CLV calculation, and pipeline analytics
Requires
- php: ^8.3
- illuminate/database: ^11.0|^12.0|^13.0
- illuminate/http: ^11.0|^12.0|^13.0
- illuminate/routing: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
Requires (Dev)
- larastan/larastan: ^2.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.5
- orchestra/testbench: ^9.5
- pestphp/pest: ^3.4
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- rector/rector: ^1.2
- spatie/laravel-ray: ^1.26
README
A lightweight CRM foundation for Laravel apps with first-party support for companies, contacts, leads, deals, activities, and a simple dashboard view.
Contents
Installation
You can install the package via composer:
composer require centrex/laravel-crm
You can publish the config file with:
php artisan vendor:publish --tag="laravel-crm-config"
This is the contents of the published config file:
return [ 'table_prefix' => 'crm_', 'drivers' => [ 'database' => [ 'connection' => env('CRM_DB_CONNECTION', env('DB_CONNECTION', 'sqlite')), ], ], ];
You can publish and run the migrations with:
php artisan vendor:publish --tag="laravel-crm-migrations"
php artisan migrate
Optionally, you can publish the views using
php artisan vendor:publish --tag="laravel-crm-views"
Usage
use Centrex\Crm\Crm; $crm = app(Crm::class); $lead = $crm->createLead([ 'title' => 'ERP rollout for Alpine Foods', 'source' => 'website', 'value' => 150000, ]); $deal = $crm->qualifyLead($lead, [ 'expected_close_date' => now()->addMonth()->toDateString(), ]); $crm->advanceDealStage($deal, 'proposal'); $summary = $crm->getPipelineSummary();
When web routes are enabled, the package also exposes a simple /crm dashboard.
Testing
๐งน Keep a modern codebase with Pint:
composer lint
โ Run refactors using Rector
composer refacto
โ๏ธ Run static analysis using PHPStan:
composer test:types
โ Run unit tests using PEST
composer test:unit
๐ Run the entire test suite:
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.