29 lines
805 B
PHP
29 lines
805 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\PurchaseHistory;
|
|
use App\Models\Tenant;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
class PurchaseHistoryFactory extends Factory
|
|
{
|
|
protected $model = PurchaseHistory::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'id' => (string) Str::uuid(),
|
|
'tenant_id' => Tenant::factory(),
|
|
'package_id' => $this->faker->randomElement(['starter', 'pro', 'enterprise']),
|
|
'price' => $this->faker->randomFloat(2, 9, 199),
|
|
'currency' => 'EUR',
|
|
'platform' => $this->faker->randomElement(['tenant-app', 'ios', 'android']),
|
|
'transaction_id' => (string) Str::uuid(),
|
|
'purchased_at' => now(),
|
|
];
|
|
}
|
|
}
|
|
|