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 123123
124124 'helper_files ' => [
125125 base_path () . '/vendor/laravel/framework/src/Illuminate/Support/helpers.php ' ,
126+ base_path () . '/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php ' ,
126127 ],
127128
128129 /*
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ public function generate()
8080 ->with ('namespaces_by_extends_ns ' , $ this ->getAliasesByExtendsNamespace ())
8181 ->with ('namespaces_by_alias_ns ' , $ this ->getAliasesByAliasNamespace ())
8282 ->with ('real_time_facades ' , $ this ->getRealTimeFacades ())
83- ->with ('helpers ' , $ this ->helpers )
83+ ->with ('helpers ' , $ this ->detectHelpers () )
8484 ->with ('include_fluent ' , $ this ->config ->get ('ide-helper.include_fluent ' , true ))
8585 ->with ('factories ' , $ this ->config ->get ('ide-helper.include_factory_builders ' ) ? Factories::all () : [])
8686 ->render ();
@@ -112,6 +112,24 @@ public function generateEloquent()
112112 ->render ();
113113 }
114114
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+
115133 protected function detectDrivers ()
116134 {
117135 $ defaultUserModel = config ('auth.providers.users.model ' , config ('auth.model ' , 'App\User ' ));
You can’t perform that action at this time.
0 commit comments