PHP code example of djlemmor / djpaykit-laravel

1. Go to this page and download the library: Download djlemmor/djpaykit-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

djlemmor / djpaykit-laravel example snippets


'admin_middleware' => ['api', 'auth'],

/*
 * Requires an authenticated Sanctum user for administrator actions.
 */
'admin_middleware' => ['api', 'auth:sanctum'],

'storage_disk' => 'local',

'providers' => [
    'gcash' => [
        'display_name' => 'GCash',
    ],

    'maya' => [
        'display_name' => 'Maya',
    ],

    'maribank' => [
        'display_name' => 'MariBank',
    ],
],

/*
 * Adds another provider without changing the package source.
 */
'providers' => [
    // Existing providers...

    'instapay' => [
        'display_name' => 'InstaPay',
    ],
],
bash
# Publishes the configuration and database migration.
php artisan djpaykit:install

# Creates the DJPayKit database table.
php artisan migrate
bash
php artisan djpaykit:install
php artisan migrate
text
config/djpaykit.php
bash
php artisan route:list --name=djpaykit
blade
{{-- Vite loads the JavaScript that registers the widget. --}}
@vite('resources/js/app.js')

<djpaykit-widget
    api-url="{{ url('/api/djpaykit/payment-methods') }}"
    order-reference="ORDER-1001"
    amount="500.00"
    currency="PHP"
></djpaykit-widget>
bash
vendor/bin/phpunit tests/Feature/PublicPaymentMethodEndpointTest.php
bash
composer exec -- phpunit tests/Feature/PublicPaymentMethodEndpointTest.php