add SMSpanel
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\SmsBilling;
|
||||
|
||||
class SmsSendResult
|
||||
{
|
||||
public function __construct(
|
||||
public readonly bool $sent,
|
||||
public readonly bool $blocked = false,
|
||||
public readonly ?string $provider = null,
|
||||
public readonly ?string $errorMessage = null,
|
||||
) {
|
||||
}
|
||||
|
||||
public static function blocked(): self
|
||||
{
|
||||
return new self(sent: false, blocked: true, errorMessage: 'ارسال پیامک موقتاً غیرفعال است');
|
||||
}
|
||||
|
||||
public static function failed(?string $message = null): self
|
||||
{
|
||||
return new self(sent: false, errorMessage: $message);
|
||||
}
|
||||
|
||||
public static function success(string $provider): self
|
||||
{
|
||||
return new self(sent: true, provider: $provider);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user