bernardinosousa / egoi-laravel
E-goi/sdk-php Wrapper for Laravel
v1.0
2023-01-20 00:26 UTC
Requires
- php: ^8.1
- e-goi/sdk-php: *@dev
- illuminate/contracts: ^9.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2025-04-09 04:27:35 UTC
README
Created this package on my free time to improve developer experience using Laravel/E-goi
I´m not affilied to E-goi
Installation
You can install the package via composer:
composer require bernardinosousa/egoi-laravel
You can publish the config file with:
php artisan vendor:publish --tag="egoi-laravel-config"
Add to .env file:
EGOI_API_KEY="YOUR_API_KEY"
Usage
use Bernardinosousa\EgoiLaravel\Facades\EgoiLaravel; //Get All Contacts from List try { $listId = 1; $contactListResponse = EgoiLaravel::api('contacts')->getAllContacts( $listId ); dump($contactResponse); } catch (\Exception $e) { dump('Exception when getting all contacts from list: ', $e->getMessage()); } //Get Contact Information from List Id and Contact Id try { $listId = 1; $contactId = "f51f0117ba"; $contactResponse = EgoiLaravel::api('contacts')->getContact( $contactId, $listId ); dump($contactResponse); } catch (\Exception $e) { dump('Exception when getting contact information: ', $e->getMessage()); } //Create Contact from List try { $contactBaseExtraPost = new \EgoiClient\EgoiModel\ContactBaseExtraPost([ 'base' => [ "status" => "active", "first_name" => "John", "last_name" => "Doe", "birth_date" => "1975-01-10", "language" => "en", "email" => "example@e-goi.com", //"cellphone" => "351-300404336", //"phone" => "351-300404336", "push_token_android" => [], "push_token_ios" => [] ] ]); $listId = 1; $contactResponse = EgoiLaravel::api('contacts')->createContact( $listId, $contactBaseExtraPost ); dump($contactResponse); } catch (\Exception $e) { dump('Exception when creating contact from list: ', $e->getMessage()); }
If you would like to have more examples, see E-goi sdk-php endpoints
Todo
- AdvancedReportsApi
- AutomationsApi
- CNamesApi
- CampaignGroupsApi
- CampaignsApi
- ConnectedSitesApi
- EcommerceApi
- EcommerceActivityApi
- EmailApi
- FieldsApi
- ListsApi
- MyAccountApi
- OperationsApi
- PingApi
- PushApi
- ReportsApi
- SegmentsApi
- SendersApi
- SmartSmsApi
- SmsApi
- SuppressionListApi
- TagsApi
- TrackEngageApi
- UsersApi
- UtilitiesApi
- VoiceApi
- WebHooksApi
- WebpushApi
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.