PHP code example of xiangyu2038 / withxy

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

    

xiangyu2038 / withxy example snippets


 
 namespace App\Models\Admin;
 use Illuminate\Database\Eloquent\Model;
 use XiangYu2038\WithXy\WithXy;
 
 class BaseModel extends Model
 {
     use WithXy;
 ////////////
}


 $need = [['boxDetail'=>['*'],'box'=>['id','box_sn','stockBox'=>['stock_id','box_sn','stock'=>['stock_sn','id']]]],'stockDetail'=>['stock_id','fashion_code','fashion_size','fashion_num','stock'=>['stock_sn','id']]];
 
 
         $fashion_model = FashionModel::where(function ($query)use($fashion_code){
             $query -> where('code',$fashion_code['fashion_code']);
         })->withxy($need)->get(['code','real_name','school']);