Skip to content

Commit

Permalink
add-getCurrentDeviceSignature-helper
Browse files Browse the repository at this point in the history
  • Loading branch information
omar95-pero committed Dec 13, 2023
1 parent c312e84 commit b6677e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,17 @@ function getCurrentDeviceSignature()
session()->get('X-DEVICE-SIGNATURE') :
request()->headers->get('X-DEVICE-SIGNATURE');
}
}

if (!function_exists('getCurrentDeviceSignature')) {
function getCurrentDeviceSignature()
{
$signature = trim(
session()->isStarted() ?
session()->get('X-DEVICE-SIGNATURE') :
request()->headers->get('X-DEVICE-SIGNATURE'),
"\s"
);
return !empty($signature) ? $signature : null;
}
}

0 comments on commit b6677e1

Please sign in to comment.