Added email and password reset
This commit is contained in:
10
app/User.php
10
app/User.php
@@ -8,6 +8,7 @@ use Laravel\Passport\HasApiTokens;
|
||||
|
||||
use Leenooks\Carbon;
|
||||
use Leenooks\Traits\UserSwitch;
|
||||
use App\Notifications\ResetPasswordNotification;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
@@ -164,14 +165,19 @@ class User extends Authenticatable
|
||||
return sprintf('<a href="/u/account/view/%s">%s</a>',$this->id,$this->user_id);
|
||||
}
|
||||
|
||||
public function scopeActive()
|
||||
{
|
||||
return $this->where('active',TRUE);
|
||||
}
|
||||
|
||||
public function isAdmin($id)
|
||||
{
|
||||
return $id AND in_array($this->role(),['wholesaler','reseller']) AND in_array($id,$this->all_accounts()->pluck('id')->toArray());
|
||||
}
|
||||
|
||||
public function scopeActive()
|
||||
public function sendPasswordResetNotification($token)
|
||||
{
|
||||
return $this->where('active',TRUE);
|
||||
$this->notify(new ResetPasswordNotification($token));
|
||||
}
|
||||
|
||||
// List all the agents, including agents of agents
|
||||
|
Reference in New Issue
Block a user