my-idlers/database/factories/ServerFactory.php
cp6 d13e170f22 V2 (Laravel re-make)
V2 (Laravel re-make)
2022-03-06 02:22:16 +11:00

43 lines
1.4 KiB
PHP

<?php
namespace Database\Factories;
use App\Models\Server;
use Illuminate\Database\Eloquent\Factories\Factory;
class ServerFactory extends Factory
{
protected $model = Server::class;
public function definition()
{
$ram = $this->faker->numberBetween(512, 4086);
$disk = $this->faker->numberBetween(5, 120);
return [
'id' => $this->faker->unique()->bothify('???#??#?'),
'hostname' => $this->faker->domainName,
'ipv4' => $this->faker->ipv4,
'ipv6' => $this->faker->ipv6,
'server_type' => $this->faker->numberBetween(1, 4),
'ns1' => null,
'ns2' => null,
'os_id' => $this->faker->numberBetween(1, 27),
'provider_id' => $this->faker->numberBetween(1, 27),
'location_id' => $this->faker->numberBetween(1, 28),
'label' => null,
//'price' => $this->faker->randomFloat(2, 2.50, 30.00),
//'currency' => 'USD',
//'payment_term' => 1,
'ram' => $ram,
'ram_as_mb' => $ram,
'disk' => $disk,
'disk_as_gb' => $disk,
'bandwidth' => $this->faker->numberBetween(100, 999),
'owned_since' => $this->faker->dateTimeThisDecade,
//'next_due_date' => date('Y-m-d',strtotime('+30 days',strtotime(str_replace('/', '-', date("Y-m-d")))))
];
}
}