From ed3fd129bfc1d4ba4f052d7f69d3d04af17fc156 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Nov 2013 07:27:10 -0500 Subject: [PATCH] Get the number of models for the depreciation --- app/models/Depreciation.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/Depreciation.php b/app/models/Depreciation.php index 8413364801..940dd35b5b 100644 --- a/app/models/Depreciation.php +++ b/app/models/Depreciation.php @@ -8,5 +8,9 @@ class Depreciation extends Elegant { 'months' => 'required|min:1|integer', ); + public function has_models() + { + return $this->hasMany('Model', 'depreciation_id')->count(); + } }