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', [])); }
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; }
public static function boot() { self::$hasher = new \Cartalyst\Sentry\Hashing\NativeHasher(); }
/** * Establish database connection */ public static function connectDatabase() { self::$db = new Database(); }
/** * 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); }