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

Added some user/view helper methods

This commit is contained in:
Dan Brown
2015-08-24 21:10:04 +01:00
parent b68f2803fc
commit 0513239c25
2 changed files with 27 additions and 0 deletions

View File

@ -33,6 +33,17 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
*/
protected $hidden = ['password', 'remember_token'];
/**
* Returns a default guest user.
*/
public static function getDefault()
{
return new static([
'email' => 'guest',
'name' => 'Guest'
]);
}
/**
* Returns the user's avatar,
* Uses Gravatar as the avatar service.