added signups to forms listing

This commit is contained in:
Jonathan Labreuille
2016-07-19 13:44:32 +02:00
parent a5300624c2
commit 1dd4ade04d
4 changed files with 17 additions and 1 deletions

View File

@ -39,6 +39,11 @@ class Form extends Model {
return parent::save();
}
function withSignups() {
$this->signups = StatisticsForms::where('form_id', $this->id)->count();
return $this;
}
static function search($orm, $search = '') {
return $orm->whereLike('name', '%'.$search.'%');
}