Skip to content

Commit

Permalink
Fix auto discovering date time from string
Browse files Browse the repository at this point in the history
  • Loading branch information
leopoletto committed Dec 26, 2020
1 parent 39d883d commit 8149745
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Support/AttributeCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function asTimestamp($value): MetaAttribute
*/
public function value($value): MetaAttribute
{
if ($timestamp = strtotime($value)) {
if (is_string($value) && $timestamp = strtotime($value)) {
$value = Carbon::createFromTimestamp($timestamp);
}

Expand Down

0 comments on commit 8149745

Please sign in to comment.