This commit is contained in:
Mekan1206
2026-05-19 21:22:36 +05:00
parent b1a6c12a00
commit e66ce8fdcd
21 changed files with 677 additions and 150 deletions

View File

@@ -2,13 +2,28 @@
namespace App\Models;
use Database\Factories\PhoneVerificationFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
class PhoneVerification extends Model
{
/** @use HasFactory<PhoneVerificationFactory> */
use HasFactory;
protected $fillable = ['phone', 'otp', 'expires_at', 'verified'];
protected $casts = [
'expires_at' => 'datetime',
'verified' => 'boolean'
];
protected function casts(): array
{
return [
'expires_at' => 'datetime',
'verified' => 'boolean',
];
}
public function coupon(): HasOne
{
return $this->hasOne(Coupon::class, 'phone', 'phone');
}
}