where('name', 'like', "%$name%"); }) ->order($order) ->paginate([ 'list_rows'=> $size, 'var_page' => 'page', ]); } public static function getByName($name) { $name = trim($name); return self::where('name', $name)->findOrEmpty(); } }