mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
42 lines
757 B
PHP
42 lines
757 B
PHP
<?php
|
|
|
|
namespace Filament\Fields;
|
|
|
|
use Filament\Traits\FieldConcerns;
|
|
|
|
class Text extends InputField
|
|
{
|
|
use FieldConcerns\CanBeAutocompleted;
|
|
use FieldConcerns\CanBeAutofocused;
|
|
use FieldConcerns\CanBeCompared;
|
|
use FieldConcerns\CanBeDisabled;
|
|
use FieldConcerns\CanBeUnique;
|
|
use FieldConcerns\CanHaveLengthConstraints;
|
|
use FieldConcerns\CanHavePlaceholder;
|
|
|
|
public $type = 'text';
|
|
|
|
public function email()
|
|
{
|
|
$this->type('email');
|
|
|
|
$this->addRules([$this->name => 'email']);
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function type($type)
|
|
{
|
|
$this->type = $type;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function password()
|
|
{
|
|
$this->type('password');
|
|
|
|
return $this;
|
|
}
|
|
}
|