deegitalbe / trustup-pro-app-common
This package contains pieces of code that are shared between our applications.
Installs: 1 239
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 2
Requires
- deegitalbe/chargebee-client: ^1.0
- deegitalbe/server-authorization: ^1.1
- deegitalbe/trustup-versioned-package: ^1.0
- henrotaym/laravel-api-client: ^1.0.10
- henrotaym/laravel-flare-exception-handler: ^1.0
- henrotaym/laravel-package-versioning-config: ^1.2
- http-interop/http-factory-guzzle: ^1.2
- hyn/multi-tenant: ^5.6
- laravel/scout: ^8.6.1|^9.4
- lcobucci/jwt: ^4.1
- meilisearch/meilisearch-php: ^0.23.0
- spatie/laravel-event-sourcing: ^3.2|^4.9
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.5
- dev-main
- v2.6.0
- v2.6.0-alpha.2
- v2.6.0-alpha.1
- v2.6.0-alpha.0
- v2.5.6
- v2.5.6-alpha.0
- v2.5.5
- v2.5.5-alpha.1
- v2.5.5-alpha.0
- v2.5.4
- v2.5.3.x-dev
- v2.5.3
- v2.5.3-alpha.0
- v2.5.2
- v2.5.2-alpha.0
- v2.5.1
- v2.5.1-alpha.12
- v2.5.1-alpha.11
- v2.5.1-alpha.10
- v2.5.1-alpha.9
- v2.5.1-alpha.8
- v2.5.1-alpha.7
- v2.5.1-alpha.6
- v2.5.1-alpha.5
- v2.5.1-alpha.4
- v2.5.1-alpha.3
- v2.5.1-alpha.2
- v2.5.1-alpha.1
- v2.5.1-alpha.0
- v2.5.0
- v2.4.24
- v2.4.23
- v2.4.22
- v2.4.21
- v2.4.20
- v2.4.19
- v2.4.18
- v2.4.17
- v2.4.16
- v2.4.15
- v2.4.14
- v2.4.13
- v2.4.12
- v2.4.11
- v2.4.10
- v2.4.9
- v2.4.8
- v2.4.7
- v2.4.6
- v2.4.5
- v2.4.4
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.9
- v2.1.8
- v2.1.7
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- 2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.6.0
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.5.4
- v0.2.4
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-feature/auth-user-via-professional-authorization-key
- dev-issue-27-Possibility_to_authenticate_user_by_professional_authorization_key
- dev-issue-25-Meilisearch_related_changes
- dev-issue-23-MeiliSearch_compatibility
- dev-issue-21-AppAccountServiceProvider_ligne_322_check_if_class_exists_on_$alias
- dev-issue-19-Handling_store_/_show_/_by_authorization_key_account_routes
- dev-issue-17-Moving_user_&_account_validation_to_this_package
- dev-issue-15-Route_to_get_all_accounts
- dev-issue-13-Update_account_chargebee_id
- dev-issue-11-exception_handling
- dev-issue-9-Write_simple_doc
- dev-issue-7-Missing_import
- dev-issue-5-setup_package_to_handle_account_update/destroy/store
This package is auto-updated.
Last update: 2024-11-20 20:22:38 UTC
README
Via composer
composer require deegitalbe/trustup-pro-app-common
Configuration
Environment
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)
Install command
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.
Preparing your model
Your model should be in charge of application professionals accounts. Typically it is App\Models\System\Account.php
Default configuration
Implements interface
Your model should implements this interface
Deegitalbe\TrustupProAppCommon\Contracts\AccountContract
Use default trait
You can use this trait in your model to synchronize automatically
Deegitalbe\TrustupProAppCommon\Models\Synchronizable
Custom configuration
Implements interface
Same step as default configuration step
Define interface methods yourself
/**
* 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;
Watch model events using package trait
You can use this trait in your model to watch its event and react to it when needed
Deegitalbe\TrustupProAppCommon\Models\SynchronizeWhenSaved