PHP code example of lyne007 / laravel-admin-sku

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

    

lyne007 / laravel-admin-sku example snippets


// key为file
if($request->hasFile('file')) {
    $file = $request->file('file');
    $path = $file->store('images');

    // 返回格式
    return ['url'=> Storage::url($path)];
}

// 新增
$form->sku('sku','商品SKU');

// 编辑
$form->sku('sku','商品SKU')->default($json);  // $json为下面的原始数据json

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

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