1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Added filtering to activity lists. Fixes #14.

This commit is contained in:
Dan Brown
2015-08-30 11:47:58 +01:00
parent f37a886205
commit 8af012bc2a
7 changed files with 90 additions and 70 deletions

View File

@ -44,15 +44,4 @@ class Entity extends Model
return $this->morphMany('Oxbow\Activity', 'entity')->orderBy('created_at', 'desc');
}
/**
* Gets only the most recent activity
* @param int $limit
* @param int $page
* @return mixed
*/
public function recentActivity($limit = 20, $page=0)
{
return $this->activity()->skip($limit*$page)->take($limit)->get();
}
}