Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How to identify between seller and customer

    General Discussion
    6
    9
    736
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      selvaraj last edited by selvaraj

      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

      1 Reply Last reply Reply Quote 0
      • ghermans
        ghermans last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • N
          Naresh-webkul last edited by

          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.

          S 1 Reply Last reply Reply Quote 0
          • S
            selvaraj @Naresh-webkul last edited by

            @Naresh-webkul Prefect, thank you

            1 Reply Last reply Reply Quote 0
            • S
              selvaraj last edited by

              I found this function been used in the default blade layout

              app('Webkul\Marketplace\Repositories\SellerRepository')->isSeller(auth()->guard('customer')->user()->id)

              1 Reply Last reply Reply Quote 0
              • R
                rahul last edited by

                Hi @selvaraj

                We have created 'isSeller' function in our repository to identify seller, you can also use this function for seller.

                Thanks

                S A 2 Replies Last reply Reply Quote 0
                • S
                  selvaraj @rahul last edited by

                  @rahul Hmm yes

                  1 Reply Last reply Reply Quote 0
                  • A
                    Aliyaa @rahul last edited by

                    @rahul said in How to identify between seller and customer:

                    We have created 'isSeller' function in our repository to identify seller, you can also use this function for seller.

                    Hi guys
                    Great job on creating the 'isSeller' function! This will be incredibly useful for identifying sellers within our repository.

                    1 Reply Last reply Reply Quote 0
                    • A
                      Amitk-Webkul last edited by

                      Yes, It will help to identify the sellers.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post