Closed NikolayMurha closed 2 years ago
Hello.
I found problem with hasOne relation with snakeCased method.
For example, when I have class like this:
class CartItem { public function productVariant() { return $this->belongsTo(ProductVariant::class); } }
And grid like this
$cartItemsGrid->column('productVariant', 'Product Variant')->display(function ($row) { return $row; });
I have an empty row because the loaded field has the name product_variant but column name like relation method - productVariant.
product_variant
When I used product_variant for relation, related data didn't load, because the relation method name does not matched:
$cartItemsGrid->column('product_variant', 'Product Variant')->display(function ($row) { return $row; });
My solution in this PR.
Hello.
I found problem with hasOne relation with snakeCased method.
For example, when I have class like this:
And grid like this
I have an empty row because the loaded field has the name
product_variant
but column name like relation method - productVariant.When I used
product_variant
for relation, related data didn't load, because the relation method name does not matched:My solution in this PR.