60 lines
1.4 KiB
PHP
60 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
class Sponsor extends Authenticatable
|
|
{
|
|
use HasFactory, Notifiable;
|
|
|
|
protected $fillable = [
|
|
'full_name',
|
|
'organization_name',
|
|
'email',
|
|
'mobile',
|
|
'password',
|
|
'country_code',
|
|
'subscription_status',
|
|
'subscription_plan',
|
|
'subscription_start_date',
|
|
'subscription_end_date',
|
|
'payment_status',
|
|
'is_verified',
|
|
'otp_verified_at',
|
|
'profile_image',
|
|
'address',
|
|
'city',
|
|
'nationality',
|
|
'status',
|
|
'last_login_at',
|
|
'api_token',
|
|
'license_file',
|
|
'emirates_id_file',
|
|
'license_expiry',
|
|
'fcm_token',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'password',
|
|
'api_token',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_verified' => 'boolean',
|
|
'otp_verified_at' => 'datetime',
|
|
'subscription_start_date' => 'datetime',
|
|
'subscription_end_date' => 'datetime',
|
|
'last_login_at' => 'datetime',
|
|
'license_expiry' => 'datetime',
|
|
];
|
|
|
|
public function hasActiveSubscription(): bool
|
|
{
|
|
return $this->subscription_status === 'active' &&
|
|
($this->subscription_end_date === null || $this->subscription_end_date->isFuture());
|
|
}
|
|
}
|