mardi 14 février 2017

ErrorException in VerifyCsrfToken.php line 156: Trying to get property of non-object laravel middleware

I am getting this error when I created my own middleware and used it

public function handle($request, Closure $next)
{
    $privilege = $request->session()->has('privilege');

    if($request->session()->has('privilege'))
    {
        if($privilege == "Owner" || $privilege == "owner")
        {
            return $next($request);
        }
        else
        {
            return redirect()->back()->withErrors(['privilege_check' => "You are not privileged to go there!."]);
        }
    }
    return '/home';
}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ktkaRl
via IFTTT

Aucun commentaire:

Enregistrer un commentaire