Getting User Data based on token in Cart Checkout API
I'm using Bagisto API and i want user cart items data based on user token which defined in API but i didn't get customer data using token, please help me.!
have you tried this endpoint ?
Yes i have used that endpoints..
can you explain me about below code to get user data using below code?
$this->guard = request()->has('token') ? 'api' : 'customer';
I have tried pass token but not getting customer data as well.
shubhwebkul last edited by shubhwebkul
Basically with this we are setting middleware in our application either api middleware or customer.
If you are sending token then it must be using api middleware
Let me know if you have any further query.
Yes, that i understood but how can i get user data i have passed token and checked i didn't get any data for user for that token, and not create object for user.
I mean is anything i need to pass for that ya only need to pass token?
You only need to pass token in that API. have you tried fetching user as used here
Yes I checked that also but $customer is blank
$customer = auth($this->guard)->user();
are you getting customer details with the help of auth('customer')->user(); ?
No, not getting customer details using that.