From ae9081af3ac39e2bf5e7e9dbc625bf42f1eb3669 Mon Sep 17 00:00:00 2001 From: merdan Date: Fri, 6 Mar 2020 16:29:29 +0500 Subject: [PATCH] sections fix --- app/Models/Section.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Models/Section.php b/app/Models/Section.php index 3ecca967..c22a37c6 100644 --- a/app/Models/Section.php +++ b/app/Models/Section.php @@ -4,6 +4,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; use Backpack\CRUD\CrudTrait; +use Illuminate\Support\Facades\Config; use Illuminate\Support\Str; class Section extends Model @@ -68,6 +69,15 @@ class Section extends Model | MUTATORS |-------------------------------------------------------------------------- */ + + public function getSectionNoAttribute(){ + return $this->{'section_no_'.Config::get('app.locale')}; + } + + public function getDescriptionAttribute(){ + return $this->{'description_'.Config::get('app.locale')}; + } + public function setSectionImageAttribute($value){ $attribute_name = "section_image"; $disk = config('filesystems.default'); // or use your own disk, defined in config/filesystems.php