Phase 0: Fundament für Inhaus
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3) - Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung - Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü - Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person - Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“ - Benutzerverwaltung im Admin, Zugang vorläufig über is_admin - vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/ - PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung - VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7197eaebf2
commit
9c0f8de791
15771 changed files with 1564103 additions and 5 deletions
133
vendor/filament/tables/docs/02-columns/08-text-input.md
vendored
Normal file
133
vendor/filament/tables/docs/02-columns/08-text-input.md
vendored
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
---
|
||||
title: Text input column
|
||||
---
|
||||
import AutoScreenshot from "@components/AutoScreenshot.astro"
|
||||
import UtilityInjection from "@components/UtilityInjection.astro"
|
||||
|
||||
## Introduction
|
||||
|
||||
The text input column allows you to render a text input inside the table, which can be used to update that database record without needing to open a new page or a modal:
|
||||
|
||||
```php
|
||||
use Filament\Tables\Columns\TextInputColumn;
|
||||
|
||||
TextInputColumn::make('email')
|
||||
```
|
||||
|
||||
<AutoScreenshot name="tables/columns/text-input/simple" alt="Text input column" version="5.x" />
|
||||
|
||||
## Validation
|
||||
|
||||
You can validate the input by passing any [Laravel validation rules](https://laravel.com/docs/validation#available-validation-rules) in an array:
|
||||
|
||||
```php
|
||||
use Filament\Tables\Columns\TextInputColumn;
|
||||
|
||||
TextInputColumn::make('name')
|
||||
->rules(['required', 'max:255'])
|
||||
```
|
||||
|
||||
## Customizing the HTML input type
|
||||
|
||||
You may use the `type()` method to pass a custom [HTML input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types):
|
||||
|
||||
```php
|
||||
use Filament\Tables\Columns\TextInputColumn;
|
||||
|
||||
TextInputColumn::make('background_color')->type('color')
|
||||
```
|
||||
|
||||
## Setting the HTML input mode
|
||||
|
||||
You may use the `inputMode()` method to set the [HTML inputmode attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode), which hints at the type of keyboard to show on mobile. For numeric inputs, use `inputMode('decimal')` for decimal values or `inputMode('numeric')` for integers:
|
||||
|
||||
```php
|
||||
use Filament\Tables\Columns\TextInputColumn;
|
||||
|
||||
TextInputColumn::make('quantity')
|
||||
->type('number')
|
||||
->inputMode('decimal')
|
||||
```
|
||||
|
||||
## Setting the numeric step
|
||||
|
||||
When using `type('number')`, you may use the `step()` method to set the [HTML step attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number#step). Use `step('any')` for decimal values or `step('1')` for integers:
|
||||
|
||||
```php
|
||||
use Filament\Tables\Columns\TextInputColumn;
|
||||
|
||||
TextInputColumn::make('quantity')
|
||||
->type('number')
|
||||
->inputMode('decimal')
|
||||
->step('1')
|
||||
```
|
||||
|
||||
## Adding affix text aside the field
|
||||
|
||||
You may place text before and after the input using the `prefix()` and `suffix()` methods:
|
||||
|
||||
```php
|
||||
use Filament\Tables\Columns\TextInputColumn;
|
||||
|
||||
TextInputColumn::make('domain')
|
||||
->prefix('https://')
|
||||
->suffix('.com')
|
||||
```
|
||||
|
||||
<UtilityInjection set="tableColumns" version="5.x">As well as allowing static values, the `prefix()` and `suffix()` methods also accept a function to dynamically calculate them. You can inject various utilities into the function as parameters.</UtilityInjection>
|
||||
|
||||
<AutoScreenshot name="tables/columns/text-input/affix" alt="Text input column with affixes" version="5.x" />
|
||||
|
||||
### Using icons as affixes
|
||||
|
||||
You may place an [icon](../../styling/icons) before and after the input using the `prefixIcon()` and `suffixIcon()` methods:
|
||||
|
||||
```php
|
||||
use Filament\Tables\Columns\TextInputColumn;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
|
||||
TextInputColumn::make('domain')
|
||||
->prefixIcon(Heroicon::GlobeAlt)
|
||||
->suffixIcon(Heroicon::CheckCircle)
|
||||
```
|
||||
|
||||
<UtilityInjection set="tableColumns" version="5.x">As well as allowing static values, the `prefixIcon()` and `suffixIcon()` methods also accept a function to dynamically calculate them. You can inject various utilities into the function as parameters.</UtilityInjection>
|
||||
|
||||
<AutoScreenshot name="tables/columns/text-input/prefix-icon" alt="Text input column with prefix icon" version="5.x" />
|
||||
|
||||
#### Setting the affix icon's color
|
||||
|
||||
Affix icons are gray by default, but you may set a different color using the `prefixIconColor()` and `suffixIconColor()` methods:
|
||||
|
||||
```php
|
||||
use Filament\Tables\Columns\TextInputColumn;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
|
||||
TextInputColumn::make('status')
|
||||
->suffixIcon(Heroicon::CheckCircle)
|
||||
->suffixIconColor('success')
|
||||
```
|
||||
|
||||
<UtilityInjection set="tableColumns" version="5.x">As well as allowing static values, the `prefixIconColor()` and `suffixIconColor()` methods also accept a function to dynamically calculate them. You can inject various utilities into the function as parameters.</UtilityInjection>
|
||||
|
||||
<AutoScreenshot name="tables/columns/text-input/suffix-icon-color" alt="Text input column with suffix icon in color" version="5.x" />
|
||||
|
||||
## Lifecycle hooks
|
||||
|
||||
Hooks may be used to execute code at various points within the input's lifecycle:
|
||||
|
||||
```php
|
||||
TextInputColumn::make()
|
||||
->beforeStateUpdated(function ($record, $state) {
|
||||
// Runs before the state is saved to the database.
|
||||
})
|
||||
->afterStateUpdated(function ($record, $state) {
|
||||
// Runs after the state is saved to the database.
|
||||
})
|
||||
```
|
||||
|
||||
## Security
|
||||
|
||||
### Authorization
|
||||
|
||||
The text input column does not automatically check Laravel Model Policies before saving changes. When a user updates a value via the text input column, Filament checks whether the column is `disabled()` but does not run any `update` policy gate check. This means that if a user can see a record in the table and the column is not disabled, they can update that column's value regardless of any `update` policy you have defined. If you need to restrict who can edit this column, you should use the `disabled()` method to conditionally prevent editing based on your own authorization logic, for example `disabled(fn ($record) => $record->user_id !== auth()->id())`. Alternatively, consider using a full edit page or modal action where Filament's resource authorization is enforced.
|
||||
Loading…
Add table
Add a link
Reference in a new issue