File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -474,9 +474,21 @@ public function setAttribute($key, $value)
474474 {
475475 parent ::setAttribute ($ key , $ value );
476476
477+ $ value = $ this ->attributes [$ key ];
478+
477479 // When writing dates the regular datetime format won't work, so we have to get JUST the date value
478480 if ($ this ->isDateAttribute ($ key ) && $ this ->hasCast ($ key , ['date ' ])) {
479- $ value = Arr::first (explode (' ' , $ this ->attributes [$ key ]));
481+ $ value = Arr::first (explode (' ' , $ value ));
482+ }
483+
484+ // FileMaker can't handle true and false, so we need to change to 1 and 0
485+ if (is_bool ($ value )) {
486+ $ value = $ value ? 1 : 0 ;
487+ }
488+
489+ // FileMaker can't handle null, so change it to ''
490+ if (is_null ($ value )) {
491+ $ value = '' ;
480492 }
481493
482494 $ this ->attributes [$ key ] = $ value ;
You can’t perform that action at this time.
0 commit comments