for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Arcanesoft\Auth\Models;
use Arcanedev\LaravelAuth\Models\User as BaseUserModel;
/**
* Class User
*
* @package Arcanesoft\Auth\Models
* @author ARCANEDEV <[email protected]>
* @property string gravatar
*/
class User extends BaseUserModel
{
/* ------------------------------------------------------------------------------------------------
| Getters & Setters
| ------------------------------------------------------------------------------------------------
* Get the user hash id.
* @return string
public function getHashedIdAttribute()
return hasher()->encode($this->id);
}
* Get the gravatar attribute.
public function getGravatarAttribute()
return gravatar()
->setDefaultImage('mm')->setSize(160)
->src($this->email);
| Main Function
* Get a user from a hashed id or fail if not found.
* @param string $hashedId
* @return self
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
public static function firstHashedOrFail($hashedId)
$id = head(hasher()->decode($hashedId));
return self::where('id', $id)->firstOrFail();