Exemplo n.º 1
0
 /**
  * Get Csrfvalidator instance
  *
  * @return static
  */
 function csrf()
 {
     $session = Session::make()->factory();
     return CsrfValidator::make($session);
 }
Exemplo n.º 2
0
 /**
  * We will set session
  *
  * @return mixed
  */
 private function setSession()
 {
     $primaryKey = null;
     $data = array();
     $primaryKey = self::$user[0]->getPrimaryKey();
     $data[$primaryKey] = self::$user[0]->{$primaryKey};
     foreach (self::$user[0]->getAttributes() as $key => $val) {
         $data[$key] = $val;
     }
     $data['isLoggedIn'] = true;
     $data['flashMsg'] = static::$msg . ucfirst($this->username);
     Session::set('auth:' . trim($this->table), $data);
     return true;
 }
Exemplo n.º 3
0
 /**
  * Check is there any flash message in session
  *
  * @param  string $key
  * @return bool
  *
  */
 public function hasFlash($key = null)
 {
     $flashArray = Session::get('flashMessages');
     if (!is_null($key)) {
         if (@isset($flashArray[$key])) {
             return @$flashArray[$key];
         }
     }
     return false;
 }