Reputation: 329
getting this error;
[Emergency] Uncaught InvalidArgumentException: has_many relation abc\def\ghi\Customer.OrderRegistrants references class Order which doesn't exist
private static $has_many = [
'OrderRegistrants' => 'Order.Registrant'
]
Upvotes: 3
Views: 382
Reputation: 24406
Assuming Order
has a namespace, you're not referencing it correctly. Try this:
private static $has_many = [
'OrderRegistrants' => Order::class . '.Registrant',
];
This will ensure that any imported (via use My\Package\Order;
for example) namespaces for the Order
class will be honoured. The way you've got it won't take any namespaces into account.
Upvotes: 2