good
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user