composer require deegitalbe/trustup-pro-app-common
Package expects you to have those lines in your .env
TRUSTUP_ADMIN_URL=
TRUSTUP_APP_KEY=
TRUSTUP_APP_KEY
key should be unique identifier for current app. (e.g: "tasks" for application taches.trustup.pro)TRUSTUP_ADMIN_URL
should be defined in development mode only. (since package already has correct value for production)
Execute this command to install package and publish configuration.
php artisan trustup_pro_app_common:install
You will then have access to config/trustup_pro_app_common.php
that you have to configure properly.
Your model should be in charge of application professionals accounts. Typically it is App\Models\System\Account.php
Your model should implements this interface
Deegitalbe\TrustupProAppCommon\Contracts\AccountContract
You can use this trait in your model to synchronize automatically
Deegitalbe\TrustupProAppCommon\Models\Synchronizable
Same step as default configuration step
/**
* Account database id.
*
* @return int
*/
public function getId(): int;
/**
* Account uuid that should be used to retrieve account details.
*
* @return string
*/
public function getUuid(): string;
/**
* Application key linked to account.
*
* @return string
*/
public function getAppKey(): string;
/**
* Professional authorization_key linked to account.
*
* @return string
*/
public function getAuthorizationKey(): string;
/**
* Subscription id linked to account.
*
* @return string|null
*/
public function getSubscriptionId(): ?string;
/**
* Subscription status linked to account.
*
* @return string|null
*/
public function getSubscriptionStatus(): ?string;
/**
* Account creation date.
*
* @return Carbon
*/
public function getCreatedAt(): Carbon;
You can use this trait in your model to watch its event and react to it when needed
Deegitalbe\TrustupProAppCommon\Models\SynchronizeWhenSaved