<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class TrackAffiliateCode
{
    public function handle(Request $request, Closure $next)
    {
        if ($request->has('ref')) {
            session(['affiliate_ref_code' => $request->get('ref')]);
        }

        return $next($request);
    }
}
