File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. This projec
55
66## Unreleased
77
8+ ## [ 4.6.0] - 2025-09-30
9+
10+ ### Added
11+
12+ - [ #44 ] ( https://github.com/laravel-json-api/eloquent/pull/44 ) New ` asInteger() ` method added to the ` DeserializesValue `
13+ trait.
14+
815## [ 4.5.0] - 2025-02-24
916
1017### Added
Original file line number Diff line number Diff line change @@ -49,6 +49,20 @@ public function asBoolean(): self
4949 return $ this ;
5050 }
5151
52+ /**
53+ * Deserialize value as a integer.
54+ *
55+ * @return $this
56+ */
57+ public function asInteger (): self
58+ {
59+ $ this ->deserializeUsing (
60+ static fn ($ value ) => filter_var ($ value , FILTER_VALIDATE_INT )
61+ );
62+
63+ return $ this ;
64+ }
65+
5266 /**
5367 * Deserialize the value.
5468 *
You can’t perform that action at this time.
0 commit comments