2023-06-01 15:02:35 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories\Mailgateway\Models;
|
|
|
|
|
|
|
|
use App\Mailgateway\Models\Mailgateway;
|
2024-10-23 21:02:42 +02:00
|
|
|
use App\Mailgateway\Types\LocalType;
|
2023-06-01 15:02:35 +02:00
|
|
|
use App\Mailgateway\Types\Type;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Mailgateway\Models\Mailgateway>
|
|
|
|
*/
|
|
|
|
class MailgatewayFactory extends Factory
|
|
|
|
{
|
|
|
|
protected $model = Mailgateway::class;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array<string, mixed>
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name' => $this->faker->words(5, true),
|
2024-10-23 21:02:42 +02:00
|
|
|
'type' => new LocalType(),
|
2023-06-01 15:02:35 +02:00
|
|
|
'domain' => $this->faker->safeEmailDomain(),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2024-10-23 21:02:42 +02:00
|
|
|
public function type(Type $type): self
|
2023-06-01 15:02:35 +02:00
|
|
|
{
|
2024-10-23 21:02:42 +02:00
|
|
|
return $this->state(['type' => $type]);
|
2023-06-01 15:02:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function name(string $name): self
|
|
|
|
{
|
|
|
|
return $this->state(['name' => $name]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function domain(string $domain): self
|
|
|
|
{
|
|
|
|
return $this->state(['domain' => $domain]);
|
|
|
|
}
|
|
|
|
}
|