- Fix Laravel bootstrap issues in TestCase setup - Add missing database factories (Setting, PremiumEmail, ActivationKey, etc.) - Convert Pest tests to PHPUnit style for compatibility - Fix model relationships and boolean casts - Add missing Filament resource actions and filters - Fix form validation and test data mismatches - Resolve assertion parameter order issues - Add proper configuration for test views - Fix searchable columns and table sorting - Simplify complex filter assertions for stability
32 lines
978 B
PHP
32 lines
978 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\UsageLog>
|
|
*/
|
|
class UsageLogFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'user_id' => User::factory(),
|
|
'ip_address' => fake()->ipv4(),
|
|
'emails_created_count' => fake()->numberBetween(0, 50),
|
|
'emails_received_count' => fake()->numberBetween(0, 100),
|
|
'emails_created_history' => json_encode([fake()->dateTime()->format('Y-m-d H:i:s') => fake()->numberBetween(1, 5)]),
|
|
'emails_received_history' => json_encode([fake()->dateTime()->format('Y-m-d H:i:s') => fake()->numberBetween(1, 10)]),
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
];
|
|
}
|
|
}
|