digikraaft / laravel-dashboard-paystack-subscriptions-tile
这是一个在 Laravel Dashboard 上显示 Paystack 订阅列表的组件
Requires
- php: ^7.4
- digikraaft/paystack-php: ^1.0
- illuminate/console: ^8.0
- illuminate/pagination: ^8.0
- illuminate/support: ^8.0
- spatie/laravel-dashboard: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-09-10 15:36:50 UTC
README
此组件可以显示 Paystack 订阅列表。它可以在 Laravel Dashboard 上使用。
安装
您可以通过 composer 安装此包
composer require digikraaft/laravel-dashboard-paystack-subscriptions-tile
您需要发布 Laravel Dashboard 包的迁移和配置文件。在 dashboard
配置文件中,您可以选择在 tiles 键中添加此配置,并根据自己的需求进行自定义
// in config/dashboard.php
'tiles' => [
/**
* Paystack configuration settings
*/
'paystack' => [
'secret_key' => env('PAYSTACK_SECRET'),
'subscriptions' => [
/**
* the values here must be supported by the Paystack API
* @link https://paystack.com/docs/api/#subscription-list
*/
'params' => [
'perPage' => 4,
],
/**
* How often should the data be refreshed in seconds
*/
'refresh_interval_in_seconds' => 1800,
],
],
],
您必须在 .env
文件中设置您的 PAYSTACK_SECRET
。您可以从 Paystack 控制面板中获取此信息。要从 Paystack 加载订阅数据,您需要安排 FetchSubscriptionsDataFromPaystackApi
命令
// in app/Console/Kernel.php
use Digikraaft\PaystackSubscriptionsTile\FetchSubscriptionsDataFromPaystackApi;
protected function schedule(Schedule $schedule)
{
$schedule->command(FetchSubscriptionsDataFromPaystackApi::class)->daily();
}
您可以根据需要更改计划的时间频率。您还可以使用 php artisan dashboard:fetch-subscriptions-data-from-paystack-api
命令。
用法
在您的仪表板视图中,您使用 livewire:paystack-subscriptions-tile
组件。
<x-dashboard> <livewire:paystack-subscriptions-tile position="e7:e16" /> </x-dashboard>
您可以选择添加一个可选的标题
<x-dashboard> <livewire:paystack-subscriptions-tile position="e7:e16" title="Paystack Subscriptions" /> </x-dashboard>
分页
默认情况下,此包按默认值分页。默认值是 4。您可以通过向组件添加 perPage
属性来更改此值
<x-dashboard> <livewire:paystack-subscriptions-tile position="e7:e16" title="Paystack Subscriptions" perPage="10" /> </x-dashboard>
测试
使用以下命令运行您的测试
composer test
更多精彩内容
请在此处查看更多免费资源 here!
变更日志
请参阅 CHANGELOG 以获取有关最近更改的更多信息。
贡献
有关详细信息,请参阅 CONTRIBUTING。
安全
如果您发现任何安全问题,请通过电子邮件 dev@digitalkraaft.com 而不是使用问题跟踪器来报告。
鸣谢
感谢
- Spatie 提供的 Laravel Dashboard 包
许可证
MIT 许可证 (MIT)。请参阅 许可证文件 获取更多信息。