Files
daragt-coupon/app/Models/PhoneVerification.php
Mekan1206 e66ce8fdcd good
2026-05-19 21:22:36 +05:00

30 lines
681 B
PHP

<?php
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 function casts(): array
{
return [
'expires_at' => 'datetime',
'verified' => 'boolean',
];
}
public function coupon(): HasOne
{
return $this->hasOne(Coupon::class, 'phone', 'phone');
}
}