-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathTurnstile.php
More file actions
68 lines (47 loc) · 1.26 KB
/
Turnstile.php
File metadata and controls
68 lines (47 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace Coderflex\FilamentTurnstile\Forms\Components;
use Coderflex\LaravelTurnstile\Rules\TurnstileCheck;
use Filament\Forms\Components\Field;
class Turnstile extends Field
{
protected string $viewIdentifier = 'turnstile';
protected string $view = 'turnstile::components.turnstile';
protected string $theme = 'auto';
protected string $size = 'normal';
protected string $language = 'en-us';
protected function setUp(): void
{
parent::setUp();
$this->label('');
$this->required();
$this->rule(new TurnstileCheck);
$this->dehydrated(false);
}
public function theme(string $theme): static
{
$this->theme = $theme;
return $this;
}
public function size(string $size): static
{
$this->size = $size;
return $this;
}
public function language(string $language): static
{
$this->language = $language;
return $this;
}
public function getTheme(): string
{
return $this->evaluate($this->theme);
}
public function getSize(): string
{
return $this->evaluate($this->size);
}
public function getLanguage(): string
{
return $this->evaluate($this->language);
}
}