ExportConfigFactory::definition()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
rs 10
1
<?php
2
3
namespace NovaExportConfiguration\Database\Factories;
4
5
use Illuminate\Database\Eloquent\Factories\Factory;
6
use NovaExportConfiguration\Models\ExportConfig;
7
8
class ExportConfigFactory extends Factory
9
{
10
    protected $model = ExportConfig::class;
11
12
    public function definition()
13
    {
14
        return [
15
            'type'           => 'default',
16
            'name'           => $this->faker->unique()->word(),
17
            'description'    => $this->faker->sentence(),
18
            'meta'           => [],
19
            'sql_query'      => null,
20
            'last_export_at' => null,
21
        ];
22
    }
23
24
    public function type(string $type): static
25
    {
26
        return $this->state([
27
            'type' => $type,
28
        ]);
29
    }
30
31
    public function name(string $name): static
32
    {
33
        return $this->state([
34
            'name' => $name,
35
        ]);
36
    }
37
}
38