Code Monkey home page Code Monkey logo

laravel-dashboard-paystack-subscriptions-tile's Introduction

A tile to show list of Paystack Subscriptions on Laravel Dashboard

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

alt Paystack Subscriptions

This tile displays the list of Paystack subscriptions. It can be used on the Laravel Dashboard.

Installation

You can install the package via composer:

composer require digikraaft/laravel-dashboard-paystack-subscriptions-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'),

            '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,
            ],
        ],
    ],

You must set your PAYSTACK_SECRET in the .env file. You can get this from your Paystack dashboard. To load subscriptions data from Paystack, you need to schedule the FetchSubscriptionsDataFromPaystackApi command:

// in app/Console/Kernel.php
use Digikraaft\PaystackSubscriptionsTile\FetchSubscriptionsDataFromPaystackApi;

protected function schedule(Schedule $schedule)
{
    $schedule->command(FetchSubscriptionsDataFromPaystackApi::class)->daily();
}

You can change the frequency of the schedule as desired. You can also use the php artisan dashboard:fetch-subscriptions-data-from-paystack-api command.

Usage

In your dashboard view you use the livewire:paystack-subscriptions-tile component.

<x-dashboard>
    <livewire:paystack-subscriptions-tile position="e7:e16" />
</x-dashboard>

You can add an optional title:

<x-dashboard>
    <livewire:paystack-subscriptions-tile position="e7:e16" title="Paystack Subscriptions" />
</x-dashboard>

Pagination

The package paginates data by default. The default value is 4. This can be changed by adding a perPage property to the tile:

<x-dashboard>
    <livewire:paystack-subscriptions-tile position="e7:e16" title="Paystack Subscriptions" perPage="10" />
</x-dashboard>

Testing

Use the command below to run your tests:

composer test

More Good Stuff

Check here for more awesome free stuff!

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

Thanks to

License

The MIT License (MIT). Please see License File for more information.

laravel-dashboard-paystack-subscriptions-tile's People

Contributors

timoladoyinbo avatar

Stargazers

 avatar

Watchers

 avatar

laravel-dashboard-paystack-subscriptions-tile's Issues

Add support for v2 of dashboard

Hi,

we've released v2 our dashboard. The only change are the updated requirements: we now require Laravel v8 and Livewire v2.

Could you please tag a new release of your tile?

In most cases these are the things you need to do:

  • update the requirement in the composer.json of your tile to spatie/laravel-dashboard": "^2.0
  • tag a new release. Personally, I would opt for a major release, so you can still do bug fixes on the v1 of your tile.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.