Skip to content

Commit 39dcb0e

Browse files
committed
laravel-translatable 6 compatibility
1 parent 8dfc97f commit 39dcb0e

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/Models/Object.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ class Object extends Base
2424

2525
protected $fillable = [
2626
'image',
27-
// Translatable columns
28-
'title',
29-
'slug',
30-
'status',
31-
'summary',
32-
'body',
3327
];
3428

3529
/**
@@ -61,19 +55,19 @@ class Object extends Base
6155
*
6256
* @return string
6357
*/
64-
public function getStatusAttribute()
58+
public function getStatusAttribute($value)
6559
{
66-
return $this->status;
60+
return $value;
6761
}
6862

6963
/**
7064
* Append title attribute from translation table.
7165
*
7266
* @return string title
7367
*/
74-
public function getTitleAttribute()
68+
public function getTitleAttribute($value)
7569
{
76-
return $this->title;
70+
return $value;
7771
}
7872

7973
/**

src/Models/ObjectTranslation.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
class ObjectTranslation extends BaseTranslation
88
{
9+
protected $fillable = [
10+
'title',
11+
'slug',
12+
'status',
13+
'summary',
14+
'body',
15+
];
16+
917
/**
1018
* get the parent model.
1119
*/

0 commit comments

Comments
 (0)