<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class VoterAuth
{
    public function handle(Request $request, Closure $next)
    {
        if (!session()->has('voter_id')) {
            return redirect()->route('voter.login')->with('error','Silakan login dengan NIS & PIN.');
        }
        return $next($request);
    }
}
