Skip to content

Commit dce519f

Browse files
committed
Revise README
1 parent 620a19e commit dce519f

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ composer require cable8mm/good-code
3535
Visit repository - <https://github.com/cable8mm/aipro>
3636

3737
```php
38+
<?php
39+
40+
use App\Models\OptionGood;
41+
use Cable8mm\GoodCode\Enums\GoodCodeType;
42+
use Cable8mm\GoodCode\GoodCode;
43+
3844
/**
3945
* For option products, retrieve the master_code of the option and update it.
4046
*/
@@ -52,6 +58,12 @@ if (GoodCodeType::of($this->data->get('sellerGoodsCd')) == GoodCodeType::OPTION)
5258
```
5359

5460
```php
61+
<?php
62+
63+
use Cable8mm\GoodCode\Enums\GoodCodeType;
64+
use Cable8mm\GoodCode\GoodCode;
65+
use Cable8mm\GoodCode\ValueObjects\SetGood;
66+
5567
/**
5668
* For composite and gift products, retrieve the set product and update the master_code.
5769
*/
@@ -76,6 +88,9 @@ if (
7688

7789
```php
7890
<?php
91+
92+
use Cable8mm\GoodCode\GoodCode;
93+
7994
print GoodCode::of('SET7369x4zz4235x6')->value();
8095
//=> ['7369'=>4,'4235'=>6]
8196

@@ -86,6 +101,10 @@ print GoodCode::setCodeOf(['1234' => 2, '5678' => 1,])->code();
86101
#### `complex-code`
87102

88103
```php
104+
<?php
105+
106+
use Cable8mm\GoodCode\GoodCode;
107+
89108
print GoodCode::of('COM10', callback: function ($key) {
90109
$a = [ 10 => '123'];
91110

@@ -97,6 +116,10 @@ print GoodCode::of('COM10', callback: function ($key) {
97116
#### `gift-code`
98117

99118
```php
119+
<?php
120+
121+
use Cable8mm\GoodCode\GoodCode;
122+
100123
print GoodCode::of('GIF11', callback: function ($key) {
101124
$a = [
102125
11 => '456',
@@ -113,6 +136,10 @@ print GoodCode::of('GIF11', callback: function ($key) {
113136
> `option-code` are matching with **both** `option-code` **and** `option-good-option` name. Unfortunately all of online shops like Coupang and 11st have not send any key for option to sellers.
114137
115138
```php
139+
<?php
140+
141+
use Cable8mm\GoodCode\GoodCode;
142+
116143
print GoodCode::of($optionCode, option: $optionName, callback: function ($key, $option) {
117144
$a = [
118145
10 => [
@@ -134,6 +161,10 @@ print GoodCode::of($optionCode, option: $optionName, callback: function ($key, $
134161
### Special value object - `SetGood`
135162

136163
```php
164+
<?php
165+
166+
use Cable8mm\GoodCode\ValueObjects\SetGood;
167+
137168
print SetGood::of('SET43x3zz253x3')->goods();
138169
//=> ['43' => 3, '253' => 3]
139170

0 commit comments

Comments
 (0)