21 lines
286 B
PHP
21 lines
286 B
PHP
<?php
|
|
|
|
/**
|
|
* Check if users have been switched
|
|
*/
|
|
namespace Leenooks\Traits;
|
|
|
|
use Session;
|
|
|
|
trait UserSwitch
|
|
{
|
|
public function getSwitchedAttribute()
|
|
{
|
|
return Session::get('orig_user');
|
|
}
|
|
|
|
public function isAdmin($id)
|
|
{
|
|
return isset($this->admin) ? $this->admin : FALSE;
|
|
}
|
|
} |