PHP code example of codeinternetapplications / shopify-oauth

1. Go to this page and download the library: Download codeinternetapplications/shopify-oauth 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/ */

    

codeinternetapplications / shopify-oauth example snippets


// $app->withFacades();

// $app->withEloquent();


$router->group([
    'middleware'    => [
        'shopify-hostname-validation',
        'shopify-hmac-validation',
        'shopify-oauth-handler',
    ]
], function() use ($router) {

    // Redirect to Polaris view
    $router->addRoute(['GET','POST','PUT'], '/[{page}]', function () {
        return view('polaris');
    });
});

    protected $listen = [
        'CodeInternetApplications\ShopifyOauth\Events\PostShopifyCallbackEvent' => [
            'App\Listeners\PostShopifyCallbackListener',  // assuming that your listener is located at App\Listeners\PostShopifyCallbackListener
        ],
    ];



namespace App\Listeners;

use CodeInternetApplications\ShopifyOauth\Events\PostShopifyCallbackEvent;

class PostShopifyCallbackListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  PostShopifyCallbackEvent  $event
     * @return void
     */
    public function handle(PostShopifyCallbackEvent $event)
    {
        // log
        \Log::channel('stack')->info('PostShopifyCallbackEvent is triggered', []);
    }
}



php artisan migrate