Skip to content

Commit

Permalink
Merge pull request #3 from ingoldsby/update-v2
Browse files Browse the repository at this point in the history
Upgrade to v2
  • Loading branch information
ingoldsby authored Nov 12, 2022
2 parents a166520 + 891a33f commit cab3a79
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ All notable changes to `laravel-dashboard-shopify-tile` will be documented in th

## 1.1.0 - 2020-06-11

- remove 'latest' product information as only the first product was able to be retrieved
- remove 'latest' product information as only the first product was able to be retrieved

## 2.0.0 - 2022-11-12

- Update to Laravel Dashboard v2 including updating PHP to v8
- Minor refactor of generateUrl in ShopifyApi
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ return [
'tiles' => [
'shopify' => [
'store' => env('SHOPIFY_STORE'),
'api_version' => '2020-04',
'api_version' => env('SHOPIFY_API_VERSION'),
'api_key' => env('SHOPIFY_API_KEY'),
'password' => env('SHOPIFY_API_PASSWORD'),
]
Expand All @@ -51,8 +51,7 @@ protected function schedule(Schedule $schedule)
}
```

In your dashboard view you can use the tile:
* `livewire:shopify-tile`
In your dashboard view you use the `livewire:shopify-tile` component.

```html
<x-dashboard>
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
}
],
"require": {
"php": "^7.4",
"spatie/laravel-dashboard": "^1.0"
"php": "^8.0.2",
"spatie/laravel-dashboard": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
Expand Down
17 changes: 5 additions & 12 deletions src/ShopifyApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,11 @@ public static function generateUrl(string $url, string $endpoint, string $type)
if ($type == 'latest') {
$url = $url . '?limit=1';

switch ($endpoint) {
case 'orders':
$url = $url . self::ORDERS_FIELDS;
break;
case 'customers':
$url = $url . self::CUSTOMERS_FIELDS;
break;
case 'checkouts':
$url = $url . self::CHECKOUTS_FIELDS;
break;
}

$url = match($endpoint) {
'checkouts' => $url . self::CHECKOUTS_FIELDS,
'customers' => $url . self::CUSTOMERS_FIELDS,
'orders' => $url . self::ORDERS_FIELDS,
};
}

return $url;
Expand Down

0 comments on commit cab3a79

Please sign in to comment.