filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
17.82k stars 2.79k forks source link

Possible bug in extraInputAttributes #4964

Closed digitall-it closed 1 year ago

digitall-it commented 1 year ago

Package

filament/forms

Package Version

v2.16.50

Laravel Version

v9.40.1

Livewire Version

v2.10.7

PHP Version

PHP 8.1.12

Problem description

While following

https://filamentphp.com/docs/2.x/forms/fields#custom-attributes

to add additional HTML attributes to the input itself, the attribute doesn't seem to be passed.

Expected behavior

Input step attribute should be "10" and instead is "any".

Steps to reproduce

Reproduction repository

https://github.com/digitall-it/extraInputAttributes-repro-1.git

Relevant log output

composer show

akaunting/laravel-money                3.1.2    Currency formatting and conversion package for Laravel
blade-ui-kit/blade-heroicons           1.3.1    A package to easily make use of Heroicons in your Laravel Blade views.
blade-ui-kit/blade-icons               1.4.1    A package to easily make use of icons in your Laravel Blade views.
brick/math                             0.10.2   Arbitrary-precision arithmetic library
danharrin/date-format-converter        v0.3.0   Convert token-based date formats between standards.
danharrin/livewire-rate-limiting       v1.0.0   Apply rate limiters to Laravel Livewire actions.
dflydev/dot-access-data                v3.0.2   Given a deep data structure, access data by dot notation.
doctrine/inflector                     2.0.6    PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.
doctrine/instantiator                  1.4.1    A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                         1.2.3    PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
dragonmantank/cron-expression          v3.3.2   CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
egulias/email-validator                3.2.1    A library for validating emails against several RFCs
fakerphp/faker                         v1.20.0  Faker is a PHP library that generates fake data for you.
filament/filament                      v2.16.50 Effortlessly build TALL-powered admin panels.
filament/forms                         v2.16.50 Effortlessly build TALL-powered forms.
filament/notifications                 v2.16.50 Effortlessly build TALL-powered notifications.
filament/support                       v2.16.50 Associated helper methods and foundation code for Filament packages.
filament/tables                        v2.16.50 Effortlessly build TALL-powered tables.
filp/whoops                            2.14.6   php error handling for cool kids
fruitcake/php-cors                     v1.2.0   Cross-origin resource sharing library for the Symfony HttpFoundation
graham-campbell/result-type            v1.1.0   An Implementation Of The Result Type
guzzlehttp/guzzle                      7.5.0    Guzzle is a PHP HTTP client library
guzzlehttp/promises                    1.5.2    Guzzle promises library
guzzlehttp/psr7                        2.4.3    PSR-7 message implementation that also provides common utility methods
hamcrest/hamcrest-php                  v2.0.1   This is the PHP port of Hamcrest Matchers
laravel/framework                      v9.40.1  The Laravel Framework.
laravel/pint                           v1.2.0   An opinionated code formatter for PHP.
laravel/sail                           v1.16.2  Docker files for running a basic Laravel application.
laravel/sanctum                        v3.0.1   Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.
laravel/serializable-closure           v1.2.2   Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.
laravel/tinker                         v2.7.3   Powerful REPL for the Laravel framework.
league/commonmark                      2.3.7    Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)
league/config                          v1.1.1   Define configuration arrays with strict schemas and access values with dot notation
league/flysystem                       3.10.3   File storage abstraction for PHP
league/mime-type-detection             1.11.0   Mime-type detection for Flysystem
league/uri-parser                      1.4.1    userland URI parser RFC 3986 compliant
livewire/livewire                      v2.10.7  A front-end framework for Laravel.
masterminds/html5                      2.7.6    An HTML5 parser and serializer.
mockery/mockery                        1.5.1    Mockery is a simple yet flexible PHP mock object framework
monolog/monolog                        2.8.0    Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy                      1.11.0   Create deep copies (clones) of your objects
nesbot/carbon                          2.63.0   An API extension for DateTime that supports 281 different languages.
nette/schema                           v1.2.2   📐 Nette Schema: validating data structures against a given Schema.
nette/utils                            v3.2.8   🛠  Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
nikic/php-parser                       v4.15.2  A PHP parser written in PHP
nunomaduro/collision                   v6.3.1   Cli error handling for console/command-line PHP applications.
nunomaduro/termwind                    v1.14.2  Its like Tailwind CSS, but for the console.
phar-io/manifest                       2.0.3    Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                        3.2.1    Library for handling version information and constraints
phpoption/phpoption                    1.9.0    Option Type for PHP
phpunit/php-code-coverage              9.2.18   Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator              3.0.6    FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker                    3.1.1    Invoke callables with a timeout
phpunit/php-text-template              2.0.4    Simple template engine.
phpunit/php-timer                      5.0.3    Utility class for timing
phpunit/phpunit                        9.5.26   The PHP Unit Testing framework.
psr/container                          2.0.2    Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                   1.0.0    Standard interfaces for event handling.
psr/http-client                        1.0.1    Common interface for HTTP clients
psr/http-factory                       1.0.1    Common interfaces for PSR-7 HTTP message factories
psr/http-message                       1.0.1    Common interface for HTTP messages
psr/log                                3.0.0    Common interface for logging libraries
psr/simple-cache                       3.0.0    Common interfaces for simple caching
psy/psysh                              v0.11.9  An interactive shell for modern PHP.
ralouphie/getallheaders                3.0.3    A polyfill for getallheaders.
ramsey/collection                      1.2.2    A PHP library for representing and manipulating collections.
ramsey/uuid                            4.6.0    A PHP library for generating and working with universally unique identifiers (UUIDs).
ryangjchandler/blade-capture-directive v0.2.2   Create inline partials in your Blade templates with ease.
sebastian/cli-parser                   1.0.1    Library for parsing CLI options
sebastian/code-unit                    1.0.8    Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup     2.0.3    Looks up which function or method a line of code belongs to
sebastian/comparator                   4.0.8    Provides the functionality to compare PHP values for equality
sebastian/complexity                   2.0.2    Library for calculating the complexity of PHP code units
sebastian/diff                         4.0.4    Diff implementation
sebastian/environment                  5.1.4    Provides functionality to handle HHVM/PHP environments
sebastian/exporter                     4.0.5    Provides the functionality to export PHP variables for visualization
sebastian/global-state                 5.0.5    Snapshotting of global state
sebastian/lines-of-code                1.0.3    Library for counting the lines of code in PHP source code
sebastian/object-enumerator            4.0.4    Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector             2.0.4    Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context            4.0.4    Provides functionality to recursively process PHP variables
sebastian/resource-operations          3.0.3    Provides a list of PHP built-in functions that operate on resources
sebastian/type                         3.2.0    Collection of value objects that represent the types of the PHP type system
sebastian/version                      3.0.2    Library that helps with managing the version number of Git-hosted PHP projects
spatie/backtrace                       1.2.1    A better backtrace
spatie/flare-client-php                1.3.1    Send PHP errors to Flare
spatie/ignition                        1.4.1    A beautiful error page for PHP applications.
spatie/invade                          1.1.1    A PHP function to work with private properties and methods
spatie/laravel-ignition                1.6.1    A beautiful error page for Laravel applications.
spatie/laravel-package-tools           1.13.7   Tools for creating Laravel packages
symfony/console                        v6.1.7   Eases the creation of beautiful and testable command line interfaces
symfony/css-selector                   v6.1.3   Converts CSS selectors to XPath expressions
symfony/deprecation-contracts          v3.1.1   A generic function and convention to trigger deprecation notices
symfony/error-handler                  v6.1.7   Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher               v6.1.0   Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
symfony/event-dispatcher-contracts     v3.1.1   Generic abstractions related to dispatching event
symfony/finder                         v6.1.3   Finds files and directories via an intuitive fluent interface
symfony/http-foundation                v6.1.7   Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                    v6.1.7   Provides a structured process for converting a Request into a Response
symfony/mailer                         v6.1.7   Helps sending emails
symfony/mime                           v6.1.7   Allows manipulating MIME messages
symfony/polyfill-ctype                 v1.27.0  Symfony polyfill for ctype functions
symfony/polyfill-intl-grapheme         v1.27.0  Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-idn              v1.27.0  Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer       v1.27.0  Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring              v1.27.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php72                 v1.27.0  Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php80                 v1.27.0  Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81                 v1.27.0  Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
symfony/polyfill-uuid                  v1.27.0  Symfony polyfill for uuid functions
symfony/process                        v6.1.3   Executes commands in sub-processes
symfony/routing                        v6.1.7   Maps an HTTP request to a set of configuration variables
symfony/service-contracts              v3.1.1   Generic abstractions related to writing services
symfony/string                         v6.1.7   Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/translation                    v6.1.6   Provides tools to internationalize your application
symfony/translation-contracts          v3.1.1   Generic abstractions related to translation
symfony/uid                            v6.1.5   Provides an object-oriented API to generate and represent UIDs
symfony/var-dumper                     v6.1.6   Provides mechanisms for walking through any arbitrary PHP variable
tgalopin/html-sanitizer                1.5.0    Sanitize untrustworthy HTML user input
theseer/tokenizer                      1.2.1    A small library for converting tokenized PHP source code into XML and potentially other formats
tijsverkoyen/css-to-inline-styles      2.2.5    CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.
vlucas/phpdotenv                       v5.5.0   Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
voku/portable-ascii                    2.0.1    Portable ASCII library - performance optimized (ascii) string functions for php.
webmozart/assert                       1.11.0   Assertions to validate method input/output with nice error messages.
danharrin commented 1 year ago

In this case, the documentation example is just bad. We actually have a step() method that you can use:

TextInput::make('points')
    ->numeric()
    ->step(10)

I will update the docs.

And it defaults to any for numeric inputs. Which is why you were seeing that attribute.