File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/Illuminate/Database/Eloquent/Concerns Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -792,11 +792,13 @@ protected function ensureCastsAreStringValues($casts)
792792 foreach ($ casts as $ attribute => $ cast ) {
793793 $ casts [$ attribute ] = match (true ) {
794794 is_object ($ cast ) => value (function () use ($ cast , $ attribute ) {
795- return $ cast instanceof Stringable
796- ? (string ) $ cast
797- : throw new InvalidArgumentException (
798- "The cast object for the {$ attribute } attribute must implement Stringable. "
799- );
795+ if ($ cast instanceof Stringable) {
796+ return (string ) $ cast ;
797+ }
798+
799+ throw new InvalidArgumentException (
800+ "The cast object for the {$ attribute } attribute must implement Stringable. "
801+ );
800802 }),
801803 is_array ($ cast ) => value (function () use ($ cast ) {
802804 if (count ($ cast ) === 1 ) {
You can’t perform that action at this time.
0 commit comments