Major incomplete Change

This commit is contained in:
Omair Saleh
2019-02-14 11:43:19 +08:00
parent 771c52883f
commit 79131671bf
138 changed files with 2345 additions and 69018 deletions
+12 -8
View File
@@ -2,15 +2,12 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Activitylog\Traits\LogsActivity;
class User extends Authenticatable
class User extends AbstractUserModel
{
use Notifiable;
// use LogsActivity;
/**
* The attributes that are mass assignable.
@@ -18,11 +15,9 @@ class User extends Authenticatable
* @var array
*/
protected $fillable = [
'first_name', 'last_name', 'email', 'password', 'verified',
'first_name', 'last_name', 'email', 'password', 'verified', 'role'
];
// protected static $logFillable = true;
/**
* The attributes that should be hidden for arrays.
*
@@ -31,4 +26,13 @@ class User extends Authenticatable
protected $hidden = [
'password', 'remember_token',
];
/**
* @return HasMany
*/
public function pendingEmailVerifications(): HasMany {
return $this->hasMany(UserEmailVerification::class, 'email')
->where('is_active', true)
->where('is_complete', false);
}
}