File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 123
123
124
124
'helper_files ' => [
125
125
base_path () . '/vendor/laravel/framework/src/Illuminate/Support/helpers.php ' ,
126
+ base_path () . '/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php ' ,
126
127
],
127
128
128
129
/*
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ public function generate()
80
80
->with ('namespaces_by_extends_ns ' , $ this ->getAliasesByExtendsNamespace ())
81
81
->with ('namespaces_by_alias_ns ' , $ this ->getAliasesByAliasNamespace ())
82
82
->with ('real_time_facades ' , $ this ->getRealTimeFacades ())
83
- ->with ('helpers ' , $ this ->helpers )
83
+ ->with ('helpers ' , $ this ->detectHelpers () )
84
84
->with ('include_fluent ' , $ this ->config ->get ('ide-helper.include_fluent ' , true ))
85
85
->with ('factories ' , $ this ->config ->get ('ide-helper.include_factory_builders ' ) ? Factories::all () : [])
86
86
->render ();
@@ -112,6 +112,24 @@ public function generateEloquent()
112
112
->render ();
113
113
}
114
114
115
+ protected function detectHelpers ()
116
+ {
117
+ $ helpers = $ this ->helpers ;
118
+
119
+ $ replacements = [
120
+ '($guard is null ? \Illuminate\Contracts\Auth\Factory : \Illuminate\Contracts\Auth\StatefulGuard) ' => '\\Auth ' ,
121
+ ];
122
+ foreach ($ replacements as $ search => $ replace ) {
123
+ $ helpers = Str::replace (
124
+ "@return {$ search }" ,
125
+ "@return $ replace| $ search " ,
126
+ $ helpers
127
+ );
128
+ }
129
+
130
+ return $ helpers ;
131
+ }
132
+
115
133
protected function detectDrivers ()
116
134
{
117
135
$ defaultUserModel = config ('auth.providers.users.model ' , config ('auth.model ' , 'App\User ' ));
You can’t perform that action at this time.
0 commit comments