for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PragmaRX\Google2FALaravel\Support;
trait Session
{
/**
* Make a session var name for.
*
* @param null $name
* @return mixed
*/
protected function makeSessionVarName($name = null)
return $this->config('session_var').(is_null($name) || empty($name) ? '' : '.'.$name);
}
* Get a session var value.
* @param null $var
public function sessionGet($var = null, $default = null)
if ($this->stateless) {
stateless
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
return $default;
return $this->getRequest()->session()->get(
$this->makeSessionVarName($var),
$default
);
* Put a var value to the current session.
* @param $var
* @param $value
protected function sessionPut($var, $value)
return $value;
$this->getRequest()->session()->put(
$value
* Forget a session var.
protected function sessionForget($var = null)
return;
$this->getRequest()->session()->forget(
$this->makeSessionVarName($var)
abstract protected function config($string, $children = []);
abstract public function getRequest();
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: