• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RonasIT / laravel-entity-generator / 26621653848

29 May 2026 06:20AM UTC coverage: 99.605% (-0.4%) from 100.0%
26621653848

Pull #279

github

web-flow
Merge a5790f518 into c9d81aa37
Pull Request #279: feat: prohibit reserved fields when creating an entity

46 of 50 new or added lines in 6 files covered. (92.0%)

1009 of 1013 relevant lines covered (99.61%)

11.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/src/Enums/ReservedFieldEnum.php
1
<?php
2

3
namespace RonasIT\EntityGenerator\Enums;
4

5
enum ReservedFieldEnum: string
6
{
7
    case Id = 'id';
8
    case CreatedAt = 'created_at';
9
    case UpdatedAt = 'updated_at';
10

11
    public function cast(): string
12
    {
NEW
13
        return match ($this) {
×
NEW
14
            self::CreatedAt,
×
NEW
15
            self::UpdatedAt => 'datetime',
×
NEW
16
            self::Id => 'integer',
×
17
        };
18
    }
19

20
    public function annotation(): string
21
    {
22
        return match ($this) {
13✔
23
            self::CreatedAt,
13✔
24
            self::UpdatedAt => 'Carbon|null',
13✔
25
            self::Id => 'int',
13✔
26
        };
27
    }
28

29
    public function novaField(): array
30
    {
31
        return match ($this) {
1✔
32
            self::Id => [
1✔
33
                'type' => 'ID',
1✔
34
                'is_required' => false,
1✔
35
            ],
1✔
36
        };
37
    }
38

39
    public static function modelLeadingAnnotations(): array
40
    {
41
        return [self::Id];
13✔
42
    }
43

44
    public static function modelTrailingAnnotations(): array
45
    {
46
        return [
13✔
47
            self::CreatedAt,
13✔
48
            self::UpdatedAt,
13✔
49
        ];
13✔
50
    }
51

52
    public static function resourceAutoFields(): array
53
    {
54
        return [
3✔
55
            self::Id,
3✔
56
            self::CreatedAt,
3✔
57
            self::UpdatedAt,
3✔
58
        ];
3✔
59
    }
60

61
    public static function novaAutoFields(): array
62
    {
63
        return [self::Id];
1✔
64
    }
65
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc