Meta information and article body cast

This commit is contained in:
2020-08-10 21:23:16 +05:00
parent 51076aca33
commit 8d8e174095
6 changed files with 23 additions and 10 deletions

View File

@@ -32,6 +32,17 @@ class Article extends Model
*/
protected $guarded = [];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'body' => 'array',
'meta' => 'array'
];
public function source()
{
return $this->belongsTo(Source::class);