spinegar/sugar7wrapper
Laravel wrapper for SugarCRM 7 REST API. Provides a clean PHP client with authentication helpers and convenient methods for common CRM operations like querying and updating records, making Sugar 7 integration quicker and more maintainable.
sugar7wrapper package is a REST client for SugarCRM, making it ideal for monolithic PHP/Laravel applications where SugarCRM integration is required. It abstracts API interactions, reducing boilerplate for CRUD operations, authentication, and data transformations.ServiceProvider (e.g., SugarCRMServiceProvider) to bind the client as a singleton.resolve(SugarCRM::class))..env integration for API endpoints, credentials, and timeouts.v11, v12). The wrapper must be tested against the targeted SugarCRM version to avoid breaking changes.retry helper or a library like spatie/retries).AppServiceProvider:
$this->app->singleton(SugarCRM::class, function ($app) {
return new SugarCRM(config('sugar.api_key'), config('sugar.endpoint'));
});
config/sugar.php:
'endpoint' => env('SUGARCRM_ENDPOINT', 'https://api.sugarcrm.com'),
'api_key' => env('SUGARCRM_API_KEY'),
'timeout' => 30,
SugarCRM::account()->find(1)) for cleaner syntax.Account::observe(SugarCRMSyncObserver::class);
sugar:sync) to avoid blocking requests:
SyncSugarCRMJob::dispatch($account)->onQueue('sugar');
find, create, update)..env, config files).php artisan sugar:ping).composer require spinegar/sugar7wrapper.php artisan vendor:publish --provider="Spinegar\Sugar7Wrapper\SugarServiceProvider".app/Services/SugarCRMAccountService).composer.json to avoid unexpected updates:
"spinegar/sugar7wrapper": "1.0.0"
SugarCRM::setDebug(true);
interface SugarCRMClientInterface {
public function find($id);
}
How can I help you explore Laravel packages today?