<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Residence extends Model {
	//
	protected $fillable = [
		'user_id',
		'name',
		'other_name',
		'day_birth',
		'month_birth',
		'year_birth',
		'gender',
		'birth_location',
		'hometown',
		'folk',
		'religion',
		'nationality',
		'id_number',
		'passport_number',
		'residence_location',
		'current_address',
		'learning',
		'skill',
		'folk_lang',
		'foreign_lang',
		'job',
		'summarize_yourself',
		'criminal',
		'summarize_family',
	];

	protected $dates = [
		'created_at',
		'updated_at'
	];

	protected $casts = [
		'summarize_yourself' => 'array',
		'summarize_family' => 'array',
	];

	public function getBirthdayAttribute()
	{
		return $this->attributes['day_birth'].'/'.$this->attributes['month_birth'].'/'.$this->attributes['year_birth'];
	}
}
