29 lines
766 B
PHP
29 lines
766 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Database\Factories;
|
||
|
|
|
||
|
|
use App\Models\AnalyticsSession;
|
||
|
|
use App\Models\PageView;
|
||
|
|
use App\Models\Visitor;
|
||
|
|
use App\Models\Website;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||
|
|
|
||
|
|
/** @extends Factory<PageView> */
|
||
|
|
class PageViewFactory extends Factory
|
||
|
|
{
|
||
|
|
public function definition(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'website_id' => Website::factory(),
|
||
|
|
'visitor_id' => Visitor::factory(),
|
||
|
|
'analytics_session_id' => AnalyticsSession::factory(),
|
||
|
|
'url' => fake()->url(),
|
||
|
|
'path' => '/'.fake()->slug(2),
|
||
|
|
'title' => fake()->sentence(3),
|
||
|
|
'referrer' => null,
|
||
|
|
'time_on_page' => fake()->numberBetween(5, 300),
|
||
|
|
'viewed_at' => now(),
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|