This tile displays the list of Paystack customers. It can be used on the Laravel Dashboard.
You can install the package via composer:
composer require digikraaft/laravel-dashboard-paystack-customers-tile
You need to publish the migrations and config file of the Laravel Dashboard package.
In the dashboard
config file, you can optionally add this configuration in the tiles key and customize it for your own needs:
// in config/dashboard.php
'tiles' => [
/**
* Paystack configuration settings
*/
'paystack' => [
'secret_key' => env('PAYSTACK_SECRET'),
'customers' => [
/**
* the values here must be supported by the Paystack API
* @link https://paystack.com/docs/api/#customer-list
*/
'params' => [
'perPage' => 100,
'from' => now()->subMonths(3)->toDateString(),
'to' => now()->toDateString(),
],
/**
* How often should the data be refreshed in seconds
*/
'refresh_interval_in_seconds' => 1800,
],
],
],
You must set your PAYSTACK_SECRET
in the .env
file. You can get this from your Paystack dashboard.
To load the customer data from Paystack, you need to schedule the FetchCustomersDataFromPaystackApi
command:
// in app/Console/Kernel.php
use Digikraaft\PaystackCustomersTile\FetchCustomersDataFromPaystackApi;
protected function schedule(Schedule $schedule)
{
$schedule->command(FetchCustomersDataFromPaystackApi::class)->twiceDaily();
}
You can change the frequency of the schedule as desired. You can also use the
php artisan dashboard:fetch-customers-data-from-paystack-api
command.
In your dashboard view you use the livewire:paystack-customers-tile
component.
<x-dashboard>
<livewire:paystack-customers-tile position="e7:e16" />
</x-dashboard>
You can add an optional title:
<x-dashboard>
<livewire:paystack-customers-tile position="e7:e16" title="Paystack Customers" />
</x-dashboard>
The package paginates data by default. The default value is 5. This can be changed by adding a perPage
property to the tile:
<x-dashboard>
<livewire:paystack-customers-tile position="e7:e16" title="Paystack Customers" perPage="10" />
</x-dashboard>
Use the command below to run your tests:
composer test
Check here for more awesome free stuff!
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email dev@digitalkraaft.com instead of using the issue tracker.
- Spatie for the Laravel Dashboard package
The MIT License (MIT). Please see License File for more information.