From fafb02488e2d0e2fd3ec1570072ee4fcad141dd9 Mon Sep 17 00:00:00 2001 From: fbarachino Date: Tue, 23 Jul 2024 10:14:01 +0000 Subject: [PATCH] Rivisto il sorting di categorie e tag nel form di modifica di un movimento. --- app/Models/Categorie.php | 2 +- app/Models/tag.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Models/Categorie.php b/app/Models/Categorie.php index b18073a..3d6d2df 100644 --- a/app/Models/Categorie.php +++ b/app/Models/Categorie.php @@ -22,7 +22,7 @@ class Categorie extends Model public static function listCategorieAPI() { // return self::select('cat_name')->pluck('cat_name'); - return self::all()->sortBy('cat_name'); + return Categorie::orderBy('cat_name')->get(); } public static function listSpesa() { diff --git a/app/Models/tag.php b/app/Models/tag.php index 76e4d72..fc1a3e8 100644 --- a/app/Models/tag.php +++ b/app/Models/tag.php @@ -17,7 +17,8 @@ class tag extends Model public static function getApiList() { //return self::select('tag_name')->pluck('tag_name'); - return self::all()->sortBy('tag_name'); + return tag::orderBy('tag_name')->get(); + // return self::select('tag_name'); } public static function inserisci($param) {