digikraaft/laravel-dashboard-stripe-customers-tile

用于在 Laravel Dashboard 上显示 Stripe 客户列表的瓷砖

v2.0 2020-09-10 05:23 UTC

This package is auto-updated.

Last update: 2024-09-10 15:12:59 UTC


README

run-tests Build Status Scrutinizer Code Quality Code Intelligence Status License: MIT

此瓷砖显示 Stripe 客户的列表。它可以在 Laravel Dashboard 上使用。

安装

您可以通过 composer 安装此包

composer require digikraaft/laravel-dashboard-stripe-customers-tile

您需要发布 Laravel Dashboard 包的迁移和配置文件。在 dashboard 配置文件中,您可以在 tiles 键中可选地添加此配置,并根据自己的需求进行自定义

// in config/dashboard.php

'tiles' => [

        /**
         * Stripe configuration settings
         */
        'stripe' => [

            'secret_key' => env('STRIPE_SECRET'),

            'customers' => [

                /**
                 * the values here must be supported by the Stripe API
                 * @link https://stripe.com/docs/api/customers/list?lang=php
                 */
                'params' => [
                    'limit' => 5,
                ],

                /**
                 * How often should the data be refreshed in seconds
                 */
                'refresh_interval_in_seconds' => 1800,
            ],
        ],
    ],

您必须在 .env 文件中设置您的 STRIPE_SECRET。您可以从您的 Stripe 控制台中获取它。要定期从 Stripe API 获取客户数据,您需要安排 FetchCustomersDataFromStripeApi 命令

// in app/Console/Kernel.php
use Digikraaft\StripeCustomersTile\FetchCustomersDataFromStripeApi;

protected function schedule(Schedule $schedule)
{
    $schedule->command(FetchCustomersDataFromStripeApi::class)->twiceDaily();
}

您可以根据需要更改计划的频率。您还可以使用 php artisan dashboard:fetch-customers-data-from-stripe-api 命令。

用法

在您的仪表板视图中,您使用 livewire:stripe-customers-tile 组件。

<x-dashboard>
    <livewire:stripe-customers-tile position="e7:e16" />
</x-dashboard>

您可以添加一个可选的标题

<x-dashboard>
    <livewire:stripe-customers-tile position="e7:e16" title="Stripe Customers" />
</x-dashboard>

分页

默认情况下,该包通过分页数据。默认值为 5。您可以通过向瓷砖添加 perPage 属性来更改此值

<x-dashboard>
    <livewire:stripe-customers-tile position="e7:e16" title="Stripe Customers" perPage="10" />
</x-dashboard>

测试

使用以下命令运行您的测试

composer test

更多好东西

请在此处查看更多免费好东西!这里

更新日志

有关最近更改的更多信息,请参阅 CHANGELOG

贡献

请参阅 CONTRIBUTING 了解详细信息。

安全

如果您发现任何与安全相关的问题,请通过电子邮件 dev@digitalkraaft.com 而不是使用问题跟踪器。

鸣谢

感谢

许可证

MIT 许可证 (MIT)。请参阅 许可证文件 了解更多信息。