Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ulrichm's avatar

Middleware problem - expects teams?

Hi

I have a Spark install without teams, but my redirectIfAuthenticated gives an error:

public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check()) {
            // Where to redirect
            return Spark::developer(Auth::user()->email) ? redirect('/admin') : redirect('/user');
        }

        return $next($request);
    }
´´´´
 Column not found: 1054 Unknown column 'email' in 'where clause' (SQL: select * from `teams` where `email` = 
0 likes
0 replies

Please or to participate in this conversation.