Skip to content

Commit 1e0e5bf

Browse files
authored
If not being used in Laravel (such as during testing) use system directory for cache
1 parent 22afc4d commit 1e0e5bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Factories/PasswordExposedCheckerFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public function instance()
3333
*/
3434
private function getCacheDirectory()
3535
{
36-
return storage_path('password-exposed-cache/');
36+
if (function_exists('storage_path')) {
37+
return storage_path('password-exposed-cache/');
38+
}
39+
40+
return sys_get_temp_dir().'/password-exposed-cache/';
3741
}
3842
}

0 commit comments

Comments
 (0)