isBroker()) { return $next($request); } $recipientUser = $request->route('recipient'); if ($recipientUser->isBroker()) { $recipient = $recipientUser->type; $isFollowing = $recipient->followers->contains($sender->id); if ($isFollowing) { return $next($request); } abort(403, 'You are not following this broker.'); } abort('404', 'Broker not found.'); } }