We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e62fa8 commit 33c649dCopy full SHA for 33c649d
src/helpers.php
@@ -14,6 +14,12 @@ function faker(string $locale = null) : \Xefi\Faker\Faker
14
15
$locale ??= 'en_US';
16
17
- return app()->makeWith(\Xefi\Faker\Faker::class, compact('locale'));
+ $abstract = \Xefi\Faker\Faker::class.':'.$locale;
18
+
19
+ if (! app()->bound($abstract)) {
20
+ app()->singleton($abstract, fn () => new \Xefi\Faker\Faker($locale));
21
+ }
22
23
+ return app()->make($abstract);
24
}
-}
25
+}
0 commit comments