<?php

class Usertask extends \Eloquent {

	use SoftDeletingTrait;

	protected $guarded		 = array();

	public function users() {
		return $this->belongsToMany('User', 'usertasks_users')->withTrashed();
	}

	public function setFineAttribute($value) {
		$value										 = str_replace(',', '.', $value);
		$value										 = str_replace(' ', '', $value);
		$this->attributes['fine']	 = round($value * 100, 0);
	}

	public function getFineAttribute() {
		return round($this->attributes['fine'] / 100, 2);
	}

}
