laravel_crm/capsulecrm

Laravel Package for capsule CRM integration

Downloads

305

Stars

3

Version

1.0.1

Latest Stable Version Total Downloads Latest Unstable Version License

laravelCapsuleCRM

Agenda

Installation

  • Install from composer
composer require laravel_crm/capsulecrm
  • Add Service Provider in config/app.php add service provider class
'providers' => [
      CapsuleCRM\CapsuleServiceProvider::class,
];
  • And add alias in config/app.php in aliases array add
'aliases' => [
      'CapsuleCRM'=>CapsuleCRM\Facades\CapsuleCRM::class,
  ];
  • Publish config file by
php artisan vendor:publish --tag=capsuleCRM --force

Configuration

  • Add in .env file three keys of capsulecrm :
    • CAPSULECRM_TOKEN get it from capsule My Preferences -> API Authentication Tokens->Personal Access Tokens
    • CAPSULECRM_APP_NAME
    • CAPSULECRM_BASE_URI default is https://api.capsulecrm.com/api/v2/

Usage

Common usage :

CapsuleCRM::{entity name}()

Example :

CapsuleCRM::party()
  • Party: Parties represent the People and Organisations on your Capsule account. His Object is :
CapsuleCRM::party();

for crud operations :

  1. Create new account :
$data = [
'name' => 'youssef daood',
'email' => '[email protected]',
'tags' => ['register','subscribe']
];
CapsuleCRM::party()->create($data);
  1. Resgister account:
$data = [
 'name' => 'youssef daood',
 'email' => '[email protected]'
 ];
 $tag = 'subscribe';
CapsuleCRM::party()->register($data, $tag);
  1. Update account:
$id = 1; // id of capsule
$data = [
'name' => 'youssef'
];
CapsuleCRM::party()->update($id, $data);
  1. validateUniqueEmail:
$email = '[email protected]';
CapsuleCRM::party()->validateUniqueEmail($email);
  1. Search
$filter = 'youssef';
CapsuleCRM::party()->search($filter);
  1. Fetch one party
$party_id=123456;
$party = CapsuleCRM::party()->fetch($party_id);
  1. Get all person objects for a party
$party_id=123456;
$people = CapsuleCRM::party()->people($party_id);
ydaood

Author

ydaood