<?php
 namespace App\Util; use TechOnline\Laravel\Dao\ModelUtil; class DefaultUtil { public static function images($type) { $images = ModelUtil::all('default_image', ['type' => $type, 'visible' => true], ['*'], ['sort', 'asc']); $list = []; foreach ($images as $image) { $list[] = [ 'image' => $image['image'], 'title' => $image['title'], ]; } return $list; } }