forked from bilfeldt/laravel-route-statistics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRouteStatisticFactory.php
24 lines (20 loc) · 962 Bytes
/
RouteStatisticFactory.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
namespace Bilfeldt\LaravelRouteStatistics\Database\Factories;
use Bilfeldt\LaravelRouteStatistics\Models\RouteStatistic;
use Illuminate\Database\Eloquent\Factories\Factory;
class RouteStatisticFactory extends Factory
{
protected $model = RouteStatistic::class;
public function definition()
{
return [
'method' => $this->faker->randomElement(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']),
'route' => $this->faker->domainWord().'.'.$this->faker->randomElement(['index', 'create', 'store', 'show', 'edit', 'update', 'destroy']),
'status' => $this->faker->randomElement([200, 201, 202, 204, 300, 301, 302, 303, 304, 400, 401, 402, 403, 404, 405, 406, 422, 429, 500, 501, 502, 503, 504]),
'parameters' => $this->faker->json(),
'ip' => $this->faker->ipv4(),
'date' => $this->faker->dateTime(),
'counter' => $this->faker->randomNumber(4),
];
}
}