Proje: Okul Platform · Hub: Okul Platform — Conventions
Nedir?
App\Http\Middleware\IdentifyCustomer — B2B customer endpoint’lerinde hangi müşteri bağlamında işlem yapıldığını belirler.
Çalışma Mekanizması
Müşteri ID Kaynakları (öncelik sırası):
x-cidheader (Customer ID)?cid=query parameter__customer_idform/body input
Sonuç:
app()->instance('authenticated_customer', $customer);
app()->instance('authenticated_customer_user', $customerUser);Controller’larda app('authenticated_customer') ile erişilir.
CustomerActingUserResolver
App\Services\Customer\CustomerActingUserResolver::resolve() — Aktif kullanıcıyı belirler.
x-auid header kullanır (eski: x-cuid) — bkz. 2026-04-17-api-x-auid-header
Müşteri ile Birlikte Yüklenenler
Middleware müşteri yüklenirken schoolFilters ilişkisini de yükler:
thumb_url, location_level_1/2/3, location_level_*_name,
school_type_id, school_type_name, py_profile_point,
product_has_* flags (is_free, show_on_homepage, is_listing_featured, etc.)
product_has_* Bayrakları
Okulun ürün paketine göre sahip olduğu özellikler:
product_has_show_inbound_number— Inbound numara gösterimproduct_has_show_article_page— Makale sayfasıproduct_has_show_article_listing_page— Makale listesiproduct_has_ads_on_rival_profile— Rakip profilde reklamproduct_has_show_on_cross_marketing— Cross marketing
İstek Reddi
x-cid yoksa veya geçersizse: JsonResponse::forbidden('messages.customer.customer_info_required')
Related
- api-b2b-customer-portal — Bu middleware kullanan route’lar
- 2026-04-17-api-x-auid-header — x-auid header kararı