mascame / formality
Form fields type guesser. Tries to detect the field type based on the name and the given config.
Installs: 71
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/mascame/formality
Requires
- php: >=7.0.0
- illuminate/support: 5.5.*
Requires (Dev)
- codeception/codeception: ^2.1
This package is not auto-updated.
Last update: 2025-10-04 02:11:54 UTC
README
Form fields type guesser. Tries to detect the field type based on the name and the given config.
Installation
composer require mascame/formality
Usage
$types = [ 'password' => [], // will match the keyword `password` 'text' => [ 'autodetect' => [ 'title', ] ], 'textarea' => [ 'autodetect' => [ 'body', ], ], 'datetime' => [ 'regex' => [ '/_at$/' ], ], ]; $parser = new Mascame\Formality\Parser\Parser($types); print $parser->parse('title'); // text print $parser->parse('body'); // textarea print $parser->parse('created_at'); // datetime print $parser->parse('password'); // password
Run Tests
vendor/bin/codecept run unit