deegitalbe / trustup-pro-app-common
此包包含我们在应用程序之间共享的代码片段。
v2.6.0
2023-02-20 16:29 UTC
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-09-20 19:55:42 UTC
README
通过composer
composer require deegitalbe/trustup-pro-app-common
配置
环境
包期望您在 .env 文件中包含以下行
TRUSTUP_ADMIN_URL=
TRUSTUP_APP_KEY=
TRUSTUP_APP_KEY
密钥应为当前应用的唯一标识符。(例如:“tasks” 用于 taches.trustup.pro 应用程序)TRUSTUP_ADMIN_URL
只应在开发模式下定义。(因为包已经为生产环境提供了正确的值)
安装命令
执行此命令以安装包并发布配置。
php artisan trustup_pro_app_common:install
然后您可以访问 config/trustup_pro_app_common.php
并正确配置它。
准备您的模型
您的模型应负责应用专业人员账户。通常它是 App\Models\System\Account.php
默认配置
实现接口
您的模型应实现此接口
Deegitalbe\TrustupProAppCommon\Contracts\AccountContract
使用默认特性
您可以在模型中使用此特性来自动同步
Deegitalbe\TrustupProAppCommon\Models\Synchronizable
自定义配置
实现接口
与默认配置步骤相同
自行定义接口方法
/**
* 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;
使用包特性监听模型事件
您可以在模型中使用此特性来监听其事件并在需要时做出反应
Deegitalbe\TrustupProAppCommon\Models\SynchronizeWhenSaved