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

Added latest activity into users list view

This commit is contained in:
Dan Brown
2020-11-20 20:10:18 +00:00
parent bd6a1a66d1
commit c0680d5717
4 changed files with 31 additions and 6 deletions

View File

@ -1,5 +1,6 @@
<?php namespace BookStack\Auth;
use BookStack\Actions\Activity;
use BookStack\Api\ApiToken;
use BookStack\Interfaces\Loggable;
use BookStack\Model;
@ -12,6 +13,7 @@ use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Notifications\Notifiable;
/**
@ -230,6 +232,14 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
return $this->hasMany(ApiToken::class);
}
/**
* Get the latest activity instance for this user.
*/
public function latestActivity(): HasOne
{
return $this->hasOne(Activity::class)->latest();
}
/**
* Get the url for editing this user.
*/