<?php
 namespace TechSoft\Laravel\News; use TechOnline\Laravel\Dao\ModelUtil; class NewsUtil { public static function listLatest($limit = 5) { return ModelUtil::model('news')->orderBy('id', 'desc')->limit($limit)->get()->toArray(); } public static function get($id) { return ModelUtil::get('news', ['id' => $id]); } public static function listCategories() { return ModelUtil::model('news_category')->orderBy('sort', 'asc')->get()->toArray(); } }