This commit is contained in:
Mathieu Lagace
2019-09-30 17:06:31 -04:00
parent d1ce6ba6da
commit 0166c48daa
38 changed files with 618 additions and 201 deletions

View File

@@ -18,7 +18,7 @@ class Event extends Model
public function user()
{
return $this->belongsTo('App\User');
return $this->belongsTo('App\User');
}
public function course($p,$l)
@@ -40,4 +40,18 @@ class Event extends Model
{
return $this->morphMany('App\Log', 'logable');
}
public static function future()
{
$events = collect();
foreach (Event::all() as $event)
{
if (date('U',strtotime($event->date_begin)) >= time())
{
$events->push($event);
}
}
return $events;
}
}