! Published.
All checks were successful
Build docker image / build_docker_image (push) Successful in 3m50s
All checks were successful
Build docker image / build_docker_image (push) Successful in 3m50s
This commit is contained in:
22
src/app/Traits/FilamentFormRequest.php
Normal file
22
src/app/Traits/FilamentFormRequest.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
trait FilamentFormRequest
|
||||
{
|
||||
/**
|
||||
* Converts complex rules to usable versions for filament
|
||||
*
|
||||
* @return array list of rules
|
||||
*
|
||||
*/
|
||||
public static function asFilamentRules(): array
|
||||
{
|
||||
//NOTE: currently all special rules are removed from the project, this is here for compatibility
|
||||
//NOTE: filament may not know the table name in a 'unique' filter, so a 'unique' should be converted to 'unique:table_name'
|
||||
//NOTE: In:: rules should be converted to array ( '->__toString()' )
|
||||
|
||||
/* @phpstan-ignore new.static (Symfony package) */
|
||||
return (new static())->rules();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user