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

conedevelopment / root / 20694177656

04 Jan 2026 02:13PM UTC coverage: 74.594% (-0.5%) from 75.049%
20694177656

push

github

iamgergo
version

3491 of 4680 relevant lines covered (74.59%)

32.44 hits per line

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

25.0
/src/Fields/Hidden.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Cone\Root\Fields;
6

7
use Closure;
8
use Cone\Root\Filters\Filter;
9
use Cone\Root\Filters\RenderableFilter;
10
use Illuminate\Database\Eloquent\Builder;
11
use Illuminate\Http\Request;
12

13
class Hidden extends Field
14
{
15
    /**
16
     * The Blade template.
17
     */
18
    protected string $template = 'root::fields.hidden';
19

20
    /**
21
     * Create a new field instance.
22
     */
23
    public function __construct(string $label, Closure|string|null $modelAttribute = null)
4✔
24
    {
25
        parent::__construct($label, $modelAttribute);
4✔
26

27
        $this->type('hidden');
4✔
28
    }
29

30
    /**
31
     * Get the filter representation of the field.
32
     */
33
    public function toFilter(): Filter
×
34
    {
35
        return new class($this) extends RenderableFilter
×
36
        {
×
37
            protected Hidden $field;
38

39
            public function __construct(Hidden $field)
40
            {
41
                parent::__construct($field->getModelAttribute());
×
42

43
                $this->field = $field;
×
44
            }
45

46
            public function apply(Request $request, Builder $query, mixed $value): Builder
47
            {
48
                return $this->field->resolveFilterQuery($request, $query, $value);
×
49
            }
50

51
            public function toField(): Hidden
52
            {
53
                return Hidden::make($this->field->getLabel(), $this->getRequestKey())
×
54
                    ->value(fn (Request $request): mixed => $this->getValue($request));
×
55
            }
56
        };
×
57
    }
58
}
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