File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11<?php namespace Taskforcedev \LaravelSupport \Helpers ;
22
3- use \Auth ;
3+ use Auth ;
4+ use Config ;
45use Illuminate \Console \AppNamespaceDetectorTrait ;
56
67class User
@@ -13,7 +14,12 @@ class User
1314 */
1415 public function getUserModel ()
1516 {
16- /* Get the namespace */
17+ /* Check the app's auth config, first */
18+ $ model = Config::get ('auth.model ' );
19+ if (class_exists ($ model )) {
20+ return $ model ;
21+ }
22+ /* That didn't work, so let's try our fallback. First get the namespace */
1723 $ ns = $ this ->getAppNamespace ();
1824 if ($ ns ) {
1925 /* Try laravel default convention (models in the app folder). */
@@ -36,7 +42,7 @@ public function getUserModel()
3642 */
3743 public function getUser ()
3844 {
39- return (Auth::check () ? \ Auth::user () : $ this ->createGuest ());
45+ return (Auth::check () ? Auth::user () : $ this ->createGuest ());
4046 }
4147
4248 /**
You can’t perform that action at this time.
0 commit comments