<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller, Session;
use Illuminate\Http\Request;

trait AuthTrait {
  public function getsession () {
    if (!Session::has('ptsess')) {
      $user = [];
      $user['local'] = $this->getLocal();
      $user['me'] = $this->getMe($user['local']);
      $user['config'] = $this->getConfig();
      $user['notify'] = $this->getNotify();
      Session::put('ptsess', $user);
      $this->user = $user;
    }
    else {
      $this->user = Session::get('ptsess');
    }

    return $user;
  }
}