support/helpers.php
<?php
function dp(...$vars)
{
foreach ($vars as $v) {
var_dump($v);
}
}
function session($key, $value = null)
{
$request = request();
if ($value === null) {
return $request->session()->get($key);
} else {
$request->session()->set($key, $value);
}
}
# 获取并删除session key
function sessionPull($key)
{
return request()->session()->pull($key);
}