belongsTo('\App\Models\Account'); } /** * The activity associated with the user. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function activity() { return $this->hasMany('\App\Models\Activity'); } /** * Get the unique identifier for the user. * * @return mixed */ public function getAuthIdentifier() { return $this->getKey(); } /** * Get the password for the user. * * @return string */ public function getAuthPassword() { return $this->password; } /** * Get the e-mail address where password reminders are sent. * * @return string */ public function getReminderEmail() { return $this->email; } /** * Get the remember token for the user. * * @return \Illuminate\Support\Collection|mixed|static */ public function getRememberToken() { return $this->remember_token; } /** * Set the remember token for the user. * * @param string $value */ public function setRememberToken($value) { $this->remember_token = $value; } /** * Get the name of the remember token for the user. * * @return string */ public function getRememberTokenName() { return 'remember_token'; } /** * Get the full name of the user. * * @return string */ public function getFullNameAttribute() { return $this->first_name . ' ' . $this->last_name; } /** * Boot all of the bootable traits on the model. */ public static function boot() { parent::boot(); static::creating(function ($user) { $user->confirmation_code = str_random(); $user->api_token = str_random(60); }); } }