Beispiel #1
0
 public function is_admin()
 {
     if (self::$is_admin != null) {
         return self::$is_admin;
     }
     return self::$is_admin = in_array($this->gapper_id, config('app.managers', []));
 }
Beispiel #2
0
 public static function exists($field, $value)
 {
     $matched_row = DB::table('users')->where($field, $value)->get();
     if (count($matched_row)) {
         self::$matched_row = reset($matched_row);
         return true;
     }
     return false;
 }
Beispiel #3
0
 public static function boot()
 {
     self::$hasher = new \Cartalyst\Sentry\Hashing\NativeHasher();
 }
Beispiel #4
0
 /**
  * Establish database connection
  */
 public static function connectDatabase()
 {
     self::$db = new Database();
 }
Beispiel #5
0
 /**
  * This must be called after update current user model
  *
  * @return void
  */
 public static function updateSession($user)
 {
     if (self::$signed) {
         self::$id = $user->id;
         self::$name = $user->name;
         self::$model = $user;
         Request::setSession('logined_user', $user->fields());
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $app_user = AppUser::all();
     //
     return response()->json($app_user, 200);
 }