<?php
namespace App\Http\Middleware;
use App\Support\ApiResponse; use Closure; use Illuminate\Http\Request;
final class RequireActiveMerchant { public function handle(Request $request,Closure $next){$m=$request->user()??$request->attributes->get('merchant'); if(!$m||$m->status!=='active') return ApiResponse::error('MERCHANT_INACTIVE','Merchant must be active.',403); return $next($request);} }
