star-insure / crm-client
Star Insure CRM Client
1.1.4
2025-05-07 05:11 UTC
Requires
- php: ^8.1
- funkjedi/composer-include-files: ^1.1
- illuminate/support: ^9.0 | ^10.0 | ^11.0 | ^12.0
- laravel/passport: ^12.0
Requires (Dev)
- phpunit/phpunit: ^10.1
README
A package for Laravel apps that includes a wrapper for the Star Inure CRM and scaffolds out routes, controllers and middleware for authenticating with the Star auth app.
Installation
You can install the package via composer:
composer require star-insure/crm-client
Add these values to your .env
file:
# CRM
CRM_API_URL=http://crm.test
CRM_API_TOKEN=dev
CRM_API_GROUP_ID=2
CRM_API_VERSION=v1
Publish config:
php artisan vendor:publish --tag=starinsure-crm
Usage
API
Call the Star CRM API by instantiating a new client, or using the StarInsure\Api\Facades\CrmApi
facade.
CrmApi::get('/account-manager-brokers');
Helper functions
Create a helpers.php
file within the app
directory (or edit your existing one):
if (! function_exists('crm')) { /** * Global helper to create an instance of the StarCrm client. */ function crm() { return new \StarInsure\Crm\CrmApi( config('crm.version'), ); } }
Autoload your helpers file in composer.json
:
"autoload": { ... "files": [ "app/helpers.php" ] },
After adding the helpers file to composer.json, you'll need to dump the autoloader
composer dump-autoload
You can now use the global helper functions and not worry about namespaces/imports.
crm()->get('/account-manager-brokers');