Skip to content

Commit 1e8a1f2

Browse files
authored
Update LocationCast.php
Fixes the error explode(): Argument tarfin-labs#2 ($string) must be of type string, Illuminate\Database\Query\Expression given
1 parent a68b379 commit 1e8a1f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Casts/LocationCast.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public function get($model, string $key, $value, array $attributes): ?Point
1717
{
1818
if (is_null($value)) {
1919
return null;
20+
}
21+
22+
if (gettype($value) !== "string") {
23+
return null;
2024
}
2125

2226
$coordinates = explode(',', $value);

0 commit comments

Comments
 (0)