2021-01-26 12:10:54 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
|
|
|
|
use Closure;
|
|
|
|
|
|
|
|
class NoSessionStore
|
|
|
|
{
|
|
|
|
protected $except = [
|
2021-06-10 13:15:52 -07:00
|
|
|
'health',
|
2021-01-26 12:10:54 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle an incoming request.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param \Closure $next
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function handle($request, Closure $next)
|
|
|
|
{
|
|
|
|
foreach ($this->except as $except) {
|
|
|
|
if ($request->is($except)) {
|
|
|
|
config()->set('session.driver', 'array');
|
|
|
|
}
|
|
|
|
}
|
2021-06-10 13:15:52 -07:00
|
|
|
|
2021-01-26 12:10:54 -08:00
|
|
|
return $next($request);
|
|
|
|
}
|
2021-06-10 13:15:52 -07:00
|
|
|
}
|