'array', ]; public function getCreatedAtAttribute() { if(isset($this->attributes['created_at'])) { return str_replace('-', '/', $this->attributes['created_at']); } } /** * @return mixed */ public function user() { return $this->belongsTo(User::class, 'extra_fields->user_id'); } /** * @return mixed */ public function sant() { return $this->belongsTo(Sant::class, 'extra_fields->from_id'); } /** * @return mixed */ public function sangh() { return $this->belongsTo(Sangh::class, 'extra_fields->sangh_id'); } public function getAttribute($key) { [$key, $path] = preg_split('/(->|\.)/', $key, 2) + [null, null]; return data_get(parent::getAttribute($key), $path); } }