57 lines
1.0 KiB
PHP
57 lines
1.0 KiB
PHP
|
<?php
|
||
|
|
||
|
|
||
|
namespace App\Services;
|
||
|
|
||
|
|
||
|
use App\Interfaces\AuthApps;
|
||
|
|
||
|
class AuthService implements AuthApps
|
||
|
{
|
||
|
|
||
|
public function check()
|
||
|
{
|
||
|
return \Session::has("AppsToken");
|
||
|
}
|
||
|
|
||
|
public function add($token)
|
||
|
{
|
||
|
\Session::forget("AppsToken");
|
||
|
\Session::put("AppsToken", $token);
|
||
|
}
|
||
|
|
||
|
public function clear()
|
||
|
{
|
||
|
\Session::forget("AppsToken");
|
||
|
\Session::flush();
|
||
|
}
|
||
|
|
||
|
public function addMsg($message)
|
||
|
{
|
||
|
\Session::put("AppsMsgInfo", $message);
|
||
|
}
|
||
|
|
||
|
public function clearMsg()
|
||
|
{
|
||
|
\Session::forget("AppsMsgInfo");
|
||
|
}
|
||
|
|
||
|
public function callMsg()
|
||
|
{
|
||
|
$msgInfo = \Session::get("AppsMsgInfo");
|
||
|
// if ($msgInfo == null)
|
||
|
if ($msgInfo != null){
|
||
|
$list['message'] = $msgInfo;
|
||
|
$this->clearMsg();
|
||
|
return view("components.alerts.alertError", $list)->render();
|
||
|
}else{
|
||
|
return "";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public function token()
|
||
|
{
|
||
|
return \Session::get("AppsToken");
|
||
|
}
|
||
|
}
|