コード例 #1
0
ファイル: IfAuthenticated.php プロジェクト: Viktor-V/LPanel
 /**
  * Handle an incoming request
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->guard()->check()) {
         return $this->redirect->route('admin', $this->app->getLocale());
     }
     return $next($request);
 }
コード例 #2
0
 /**
  * Get User
  *
  * @return \Illuminate\Contracts\Auth\Authenticatable
  */
 protected function getUser()
 {
     if (!$this->user) {
         $authGuard = $this->config->get('nwlaravel.activity.auth_guard') ?: $this->auth->getDefaultDriver();
         $this->user = $this->auth->guard($authGuard)->user();
     }
     return $this->user;
 }
コード例 #3
0
 public function __construct(AuthManager $auth, Repository $config)
 {
     $this->auth = $auth;
     $this->properties = collect();
     $authDriver = $config['laravel-activitylog']['default_auth_driver'] ?? $auth->getDefaultDriver();
     if (starts_with(app()->version(), '5.1')) {
         $this->causedBy = $auth->driver($authDriver)->user();
     } else {
         $this->causedBy = $auth->guard($authDriver)->user();
     }
     $this->logName = $config['laravel-activitylog']['default_log_name'];
     $this->logEnabled = $config['laravel-activitylog']['enabled'] ?? true;
 }
コード例 #4
0
 /**
  * Attempt to get the guard from the local cache.
  *
  * @param string $name
  * @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard 
  * @static 
  */
 public static function guard($name = null)
 {
     return \Illuminate\Auth\AuthManager::guard($name);
 }
コード例 #5
0
ファイル: AuthController.php プロジェクト: Viktor-V/LPanel
 /**
  * Log the user out of the admin and redirect him to auth page
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function getLogout()
 {
     $this->auth->guard()->logout();
     return $this->redirect->route('auth');
 }
コード例 #6
0
 /**
  * Create a new basic provider instance.
  *
  * @param \Illuminate\Auth\AuthManager $auth
  */
 public function __construct(AuthManager $auth)
 {
     $this->auth = $auth->guard($this->guard);
 }