mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
66 lines
2.1 KiB
PHP
66 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Eloquent;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Support\Carbon;
|
|
use Spatie\Activitylog\Models\Activity;
|
|
|
|
/**
|
|
* App\Models\UserEmailVerification
|
|
*
|
|
* @property int $id
|
|
* @property string $email
|
|
* @property string $token
|
|
* @property int $is_complete
|
|
* @property int $is_active
|
|
* @property int $is_sent
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
* @property-read Collection|Activity[] $activities
|
|
* @property-read int|null $activities_count
|
|
* @property-read Model|Eloquent $causer
|
|
* @property-read Model|Eloquent $subject
|
|
* @property-read Model|Eloquent $target
|
|
* @property-read User $user
|
|
* @method static Builder|UserEmailVerification active()
|
|
* @method static Builder|UserEmailVerification newModelQuery()
|
|
* @method static Builder|UserEmailVerification newQuery()
|
|
* @method static Builder|UserEmailVerification query()
|
|
* @method static Builder|UserEmailVerification whereCreatedAt($value)
|
|
* @method static Builder|UserEmailVerification whereEmail($value)
|
|
* @method static Builder|UserEmailVerification whereId($value)
|
|
* @method static Builder|UserEmailVerification whereIsActive($value)
|
|
* @method static Builder|UserEmailVerification whereIsComplete($value)
|
|
* @method static Builder|UserEmailVerification whereIsSent($value)
|
|
* @method static Builder|UserEmailVerification whereToken($value)
|
|
* @method static Builder|UserEmailVerification whereUpdatedAt($value)
|
|
* @mixin Eloquent
|
|
*/
|
|
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');
|
|
}
|
|
}
|