From 4a75a9f38820e9b38ecb16b35d75803103bdb372 Mon Sep 17 00:00:00 2001 From: Olivier Legat Date: Sun, 23 Jan 2022 12:38:29 +0100 Subject: [PATCH] make Text Model translatable --- app/Models/Text.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Models/Text.php b/app/Models/Text.php index 387d895..65cc06a 100644 --- a/app/Models/Text.php +++ b/app/Models/Text.php @@ -3,14 +3,14 @@ namespace App\Models; use App\Enums\Page; +use App\Traits\CastsEnumsHasTranslations; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -use Kwaadpepper\Enum\Traits\CastsEnums; class Text extends Model { use HasFactory; - use CastsEnums; + use CastsEnumsHasTranslations; public $enumCasts = [ 'page' => Page::class @@ -20,4 +20,9 @@ class Text extends Model 'title', 'text', ]; + + public $translatable = [ + 'title', + 'text', + ]; }