<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class todoBackups extends Model
{
	protected $table = 'todo_backups';

	protected $casts = [
    'timestamp'  => 'date:Y-m-d',
    'completed_at' => 'datetime:Y-m-d H:m',
];

	    protected $fillable = [
	    	'hostname', 'timestamp', 'status', 'node', 'solvedBy', 'assigned', 'completed_at',
	    ];

	    public function assignee() {
	    	return $this->hasOne('App\User','id','assigned');
	    }

	    public function solver() {
	    	return $this->hasOne('App\User','id','solvedBy');
	    }

	    	    public function comments() {
	    	return $this->hasMany('App\todoComments','relationID','id');
	    }
}
