* $order->belongsTo(Customer::class, 'customer_id') * ); */ public function boot(): void { ChartOfAccount::resolveRelationUsing('product', fn (ChartOfAccount $coa) => $coa->hasMany(Product::class, 'coa_id') ); Product::resolveRelationUsing('chartOfAccount', fn (Product $product) => $product->belongsTo(ChartOfAccount::class, 'chart_of_account_id') ); } }