PHP code example of portside-labs / laravel-shopify

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

    

portside-labs / laravel-shopify example snippets


$request->shop()->api()->graphql('{ shop { name } }')->json('data.shop');

class OrdersCreate implements ShouldQueue
{
    public function __construct(public Shop $shop, public array $payload) {}
}

Route::get('/reports', ReportController::class)->middleware('subscribed');

$shop->subscribed();          // on any active plan
$shop->subscribed('pro');     // on this plan in particular
$shop->onTrial();
$shop->subscription()?->plan;
$shop->planSelectionUrl();