File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/Illuminate/Foundation/Testing Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,14 @@ protected function faker($locale = null)
43
43
*/
44
44
protected function makeFaker ($ locale = null )
45
45
{
46
- $ locale ??= config ('app.faker_locale ' , Factory::DEFAULT_LOCALE );
46
+ if (isset ($ this ->app )) {
47
+ $ locale ??= $ this ->app ->make ('config ' )->get ('app.faker_locale ' , Factory::DEFAULT_LOCALE );
47
48
48
- if (isset ($ this ->app ) && $ this ->app ->bound (Generator::class)) {
49
- return $ this ->app ->make (Generator::class, ['locale ' => $ locale ]);
49
+ if ($ this ->app ->bound (Generator::class)) {
50
+ return $ this ->app ->make (Generator::class, ['locale ' => $ locale ]);
51
+ }
50
52
}
51
53
52
- return Factory::create ($ locale );
54
+ return Factory::create ($ locale ?? Factory:: DEFAULT_LOCALE );
53
55
}
54
56
}
You can’t perform that action at this time.
0 commit comments