From 75549a726ce414d8cb81a280279284aa55ca7bd6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 12 Jul 2023 19:15:52 +1000 Subject: [PATCH] Add thai baht currency code. --- app/Casts/EncryptedCast.php | 2 +- ...2_074829_add_thai_baht_currency_symbol.php | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2023_07_12_074829_add_thai_baht_currency_symbol.php diff --git a/app/Casts/EncryptedCast.php b/app/Casts/EncryptedCast.php index e13c69625d..7be926072c 100644 --- a/app/Casts/EncryptedCast.php +++ b/app/Casts/EncryptedCast.php @@ -17,7 +17,7 @@ class EncryptedCast implements CastsAttributes { public function get($model, string $key, $value, array $attributes) { - return strlen($value) > 1 ? decrypt($value) : null; + return is_string($value) && strlen($value) > 1 ? decrypt($value) : null; } public function set($model, string $key, $value, array $attributes) diff --git a/database/migrations/2023_07_12_074829_add_thai_baht_currency_symbol.php b/database/migrations/2023_07_12_074829_add_thai_baht_currency_symbol.php new file mode 100644 index 0000000000..fe959e0374 --- /dev/null +++ b/database/migrations/2023_07_12_074829_add_thai_baht_currency_symbol.php @@ -0,0 +1,34 @@ +symbol = '฿'; + $tb->save(); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +};