| Conditions | 2 | 
| Paths | 1 | 
| Total Lines | 8 | 
| Code Lines | 6 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 6 | 
| CRAP Score | 2 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 18 | 2 | public function handle(HasAsset $model, $type, $sorting)  | 
            |
| 19 |     { | 
            ||
| 20 | 2 | $files = $model->assets($type);  | 
            |
| 
                                                                                                    
                        
                         | 
                |||
| 21 |         $files->each(function ($asset) use ($model, $sorting) { | 
            ||
| 22 | 2 |             if (in_array($asset->id, $sorting)) { | 
            |
| 23 | 2 | $pivot = $model->assetRelation->find($asset->id)->pivot;  | 
            |
| 24 | 2 | $pivot->order = array_search($asset->id, $sorting);  | 
            |
| 25 | 2 | $pivot->save();  | 
            |
| 26 | }  | 
            ||
| 30 |