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:
@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user