<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

use Carbon\Carbon;

class Festive extends Model
{
	use SoftDeletes;
	
	protected $table = 'festives';
	protected $dates = ['deleted_at','date'];

	protected $fillable = [
		'name',
		'date',
		'port_id'
	
	];

	public function port()
	{
		return $this->belongsTo('App\Port');
	}

	
		public function setDateAttribute($date){
		$this->attributes['date'] = Carbon::parse($date);
	}
	
	public function getDAteAttribute($date){
		return Carbon::parse($date)->format('m/d/Y');
	}
			
}
