Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/Helpers/User.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php namespace Taskforcedev\LaravelSupport\Helpers;

use \Auth;
use Auth;
use Config;
use Illuminate\Console\AppNamespaceDetectorTrait;

class User
Expand All @@ -13,7 +14,12 @@ class User
*/
public function getUserModel()
{
/* Get the namespace */
/* Check the app's auth config, first */
$model = Config::get('auth.model');
if (class_exists($model)) {
return $model;
}
/* That didn't work, so let's try our fallback. First get the namespace */
$ns = $this->getAppNamespace();
if ($ns) {
/* Try laravel default convention (models in the app folder). */
Expand All @@ -36,7 +42,7 @@ public function getUserModel()
*/
public function getUser()
{
return (Auth::check() ? \Auth::user() : $this->createGuest());
return (Auth::check() ? Auth::user() : $this->createGuest());
}

/**
Expand Down