PHP code example of loongws / laravel-admin-sku

1. Go to this page and download the library: Download loongws/laravel-admin-sku 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/ */

    

loongws / laravel-admin-sku example snippets


$form->sku('sku_field','商品SKU');

// 设置默认 SKU 数据
$form->sku('sku_field','商品SKU')->skuDefault($skuDefaultData);

// 设置默认规格数据
$form->sku('sku_field','商品SKU')->specDefault($specDefaultData);

// 设置初始 key
$form->sku('sku_field','商品SKU')->setStartKey($startGroupKey,$startKey);

// 设置自定义字段
$form->sku('sku_field','商品SKU')->fixedParam($fixedParam);

// 处理数据
$form->saving(function($form) {
    dd($form->sku_field);
});

// 修改时需要同时设置默认 SKU 数据、默认规格数据、初始 key,如果设置了自定义字段,还需要同时设置自定义字段
$form->sku('sku_field', __('SKU 管理'))->fixedParam($fixedParam)->skuDefault($skuDefaultData)->specDefault($specDefaultData)->setStartKey($startGroupKey,$startKey);