mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-19 12:34:01 +00:00
29 lines
613 B
PHP
29 lines
613 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class UserEmailVerification extends AbstractModel
|
|
{
|
|
protected $table = 'user_email_verifications';
|
|
|
|
public $fillable = [
|
|
'token', 'is_complete', 'is_active', 'is_sent'
|
|
];
|
|
/**
|
|
* @param $query
|
|
* @return mixed
|
|
*/
|
|
public function scopeActive($query){
|
|
return $query->where('is_active', true)->where('is_complete', false);
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo
|
|
*/
|
|
public function user(): BelongsTo {
|
|
return $this->belongsTo(User::class, 'email', 'email');
|
|
}
|
|
}
|