Added a very basic metric API. Closes #4

This commit is contained in:
Joseph Cohen
2015-01-21 02:32:18 -06:00
committed by James Brooks
parent 99964998ec
commit cfd3df4266
32 changed files with 606 additions and 45 deletions

View File

@@ -3,6 +3,7 @@
namespace CachetHQ\Cachet\Models;
use Illuminate\Database\Eloquent\Model;
use Watson\Validating\ValidatingTrait;
/**
* @property int $id
@@ -13,6 +14,24 @@ use Illuminate\Database\Eloquent\Model;
*/
class MetricPoint extends Model
{
use ValidatingTrait;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['metric_id', 'value'];
/**
* The validation rules.
*
* @var string[]
*/
protected $rules = [
'value' => 'integer|required',
];
/**
* A metric point belongs to a metric unit.
*