protected $middleware = [
\\App\\Http\\Middleware\\Syspoint::class,
]
use Session;
class Syspoint
{
echo \\Session::get(\'syspoint\');
}
You are calling Session but it is not already started.
If you need Session inside your middleware you have to put it in the property protected $middlewareGroups
under the key web
and after the call to StartSession, i.e.:
protected $middlewareGroups
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\App\Http\Middleware\Syspoint::class,