Closed Muneebkh2 closed 3 years ago
also you can use relation like this
auth()->user()->ratings()->where('product_id', $product->id)->first()
or add a scope for getting one project from relation
Your second comment I think beter for use
I user relationship so, in this case, no need to call auth user_id again.
Thank you for your review.
https://github.com/alijumaan/Laravel-Ecommerce/blob/0fd727565de50cd3063262d7738a53a2f539cc8a/app/Repositories/Frontend/ProductRepository.php#L71
you just need to save auth user id in var to reuse in method. you also use this in line 76.
AuthUserId = auth()->user()->id