From b96d012ce80914327d2a1ec6e2ee721bd218b5e2 Mon Sep 17 00:00:00 2001 From: James-jamames Date: Thu, 26 Oct 2023 11:00:39 -0300 Subject: [PATCH] + Articles update --- server/app/Models/Article.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/server/app/Models/Article.php b/server/app/Models/Article.php index 6f8182c..a3d7840 100644 --- a/server/app/Models/Article.php +++ b/server/app/Models/Article.php @@ -10,16 +10,15 @@ class Article extends Model { use HasFactory, Translatable; - protected $translatable = ['title', 'description']; + protected $translatable = ['title', 'abstract']; protected $table = "articles"; protected $fillable = [ 'title', - 'description', + 'abstract', 'authors', 'image', - 'file_pt', - 'file_en', + 'doi', ]; public static function getTranslate(string $lang) @@ -33,16 +32,7 @@ public static function getTranslate(string $lang) $article[$translation->column_name] = $translation->value; } - if($lang == "en") - { - $article["file"] = $article->file_en; - } - else - { - $article["file"] = $article->file_pt; - } - - unset($article->translations, $article->file_pt, $article->file_en); + unset($article->translations); } return $articles;