Skip to content

Commit

Permalink
add laravel casts support
Browse files Browse the repository at this point in the history
  • Loading branch information
514sid committed Aug 15, 2023
1 parent a0e9ced commit 5570ce5
Show file tree
Hide file tree
Showing 10 changed files with 7,221 additions and 770 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ Num::float('12.345') // float(12345.0)
Num::float('1234,567') // float(1234.567)
```

## Laravel Casts

```php
use Num\Casts\NumInt;
use Num\Casts\NumFloat;

protected $casts = [
'integer' => NumInt::class,
'float' => NumFloat::class,
];
```

## License

[MIT](LICENSE)
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
"php": "^8.1"
},
"require-dev": {
"phpunit/phpunit": "^10.1"
"phpunit/phpunit": "^10.1",
"orchestra/testbench": "^8.8"
},
"scripts": {
"tests": "phpunit"
"tests": "phpunit",
"post-autoload-dump": [
"@php vendor/bin/testbench package:discover --ansi"
]
}
}
}
Loading

0 comments on commit 5570ce5

Please sign in to comment.