CastWith
This commit is contained in:
parent
bef42b3352
commit
afb47c1977
7 changed files with 56 additions and 26 deletions
18
src/Config.php
Normal file
18
src/Config.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Icefox\DTO;
|
||||
|
||||
class Config
|
||||
{
|
||||
public static function getCaster(string $className): ?callable
|
||||
{
|
||||
return config('dto.cast.' . $className, null);
|
||||
}
|
||||
|
||||
public static function getRules(string $className): ?callable
|
||||
{
|
||||
return config('dto.rules.' . $className, null);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue