Get the number of models for the depreciation

This commit is contained in:
snipe
2013-11-20 07:27:10 -05:00
parent 53e6d22f83
commit ed3fd129bf
+4
View File
@@ -8,5 +8,9 @@ class Depreciation extends Elegant {
'months' => 'required|min:1|integer',
);
public function has_models()
{
return $this->hasMany('Model', 'depreciation_id')->count();
}
}