Witam!
Mam 3 tabele w bazie danych:
Products:
id
name
Colors:
id
name
Products_has_colors
product_id
color_id
Każdy produkt może być opisany jednocześnie przez kilka kolorów (relacja n-m)
W modelu mam:
product.php:
protected $belongs_to_many = array('Product_has_colors');
colors.php:
protected $belongs_to_many = array('Product_has_colors');
product_has_colors.php:
protected $has_and_belongs_to_many = array('products, colors');
Nie mogę odczytać wyników tego zapytania w kontrolerze products.php
Czy coś źle zapisuję?