How to identify between seller and customer
-
Hi,
How to identity difference between seller and customer
Example
for customer we use if(auth('customer')) and for seller how we can check ?
Thank you
-
This post is deleted! -
Hi,
- The seller is the one who consumes the goods. seller is a person who is the end user of the product.
- customer is the person who buys the goods or services and pays the price.
- every seller is a type of customer but it is not necessary that every customer also be a seller.
you can check seller using sellerRepository following :
$seller = $this->sellerRepository->findOneByField('customer_id', auth()->guard('customer')->user()->id);
where we are checking that current customer is a seller or not and customer_id ,column is reference to the customer table.
-
@Naresh-webkul Prefect, thank you
-
I found this function been used in the default blade layout
app('Webkul\Marketplace\Repositories\SellerRepository')->isSeller(auth()->guard('customer')->user()->id)
-
Hi @selvaraj
We have created 'isSeller' function in our repository to identify seller, you can also use this function for seller.
Thanks
-
@rahul Hmm yes