Add SMS bulk delay configuration and validate coupon phone function
This commit is contained in:
39
database/factories/SmsCampaignFactory.php
Normal file
39
database/factories/SmsCampaignFactory.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\SmsCampaign;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<SmsCampaign>
|
||||
*/
|
||||
class SmsCampaignFactory extends Factory
|
||||
{
|
||||
protected $model = SmsCampaign::class;
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'message' => fake()->sentence(),
|
||||
'mode' => 'all',
|
||||
'recipient_count' => 0,
|
||||
'sent_count' => 0,
|
||||
'failed_count' => 0,
|
||||
'skipped_count' => 0,
|
||||
'created_by' => User::factory(),
|
||||
'completed_at' => null,
|
||||
];
|
||||
}
|
||||
|
||||
public function completed(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes): array => [
|
||||
'completed_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user