mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
3.2.4
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user