How to identify between seller and customer
selvaraj last edited by selvaraj
How to identity difference between seller and customer
for customer we use if(auth('customer')) and for seller how we can check ?
ghermans last edited by
This post is deleted!
Naresh-webkul last edited by
- 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
rahul last edited by
We have created 'isSeller' function in our repository to identify seller, you can also use this function for seller.
@rahul Hmm yes