digikraaft / laravel-dashboard-stripe-payments-tile
一个在 Laravel Dashboard 上显示 Stripe 付款列表的瓷砖
Requires
- php: ^7.4
- illuminate/console: ^8.0
- illuminate/pagination: ^8.0
- illuminate/support: ^8.0
- spatie/laravel-dashboard: ^2.0
- stripe/stripe-php: ^7.46
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-09-10 14:22:20 UTC
README
此瓷砖显示 Stripe 客户的列表。它可以在 Laravel Dashboard 上使用。
安装
您可以通过 composer 安装此包
composer require digikraaft/laravel-dashboard-stripe-payments-tile
您需要发布 Laravel Dashboard 包的迁移和配置文件。在 dashboard
配置文件中,您可以在 tiles 键中添加此配置,并根据您的需求进行自定义
// in config/dashboard.php
'tiles' => [
/**
* Stripe configuration settings
*/
'stripe' => [
'secret_key' => env('STRIPE_SECRET'),
'payments' => [
/**
* the values here must be supported by the Stripe API
* @link https://stripe.com/docs/api/charges?lang=php
*/
'params' => [
'limit' => 5,
],
/**
* How often should the data be refreshed in seconds
*/
'refresh_interval_in_seconds' => 1800,
],
],
],
您必须在 .env
文件中设置您的 STRIPE_SECRET
。您可以从您的 Stripe 控制面板中获取此信息。为了定期从 Stripe 加载客户数据,您需要安排 FetchPaymentsDataFromStripeApi
命令
// in app/Console/Kernel.php
use Digikraaft\StripePaymentsTile\FetchPaymentsDataFromStripeApi;
protected function schedule(Schedule $schedule)
{
$schedule->command(FetchPaymentsDataFromStripeApi::class)->twiceDaily();
}
您可以根据需要更改计划的频率。您还可以使用 php artisan dashboard:fetch-payments-data-from-stripe-api
命令。
用法
在您的仪表板视图中,您使用 livewire:stripe-payments-tile
组件。
<x-dashboard> <livewire:stripe-payments-tile position="e7:e16" /> </x-dashboard>
您可以添加一个可选的标题
<x-dashboard> <livewire:stripe-payments-tile position="e7:e16" title="Stripe Payments" /> </x-dashboard>
分页
默认情况下,该包通过分页数据。默认值为 5。您可以通过向瓷砖添加 perPage
属性来更改此值
<x-dashboard> <livewire:stripe-payments-tile position="e7:e16" title="Stripe Payments" perPage="10" /> </x-dashboard>
测试
使用以下命令运行您的测试
composer test
更多精彩内容
请访问此处获取更多免费精彩内容!
更新日志
请参阅 CHANGELOG 了解最近更改的详细信息。
贡献
请参阅 CONTRIBUTING 了解详细信息。
安全
如果您发现任何与安全相关的问题,请通过电子邮件 dev@digitalkraaft.com 联系,而不是使用问题跟踪器。
致谢
感谢
- Spatie 提供的 Laravel Dashboard 包
许可证
MIT 许可证 (MIT)。请参阅 许可证文件 了解更多信息。