Level 70
@hakeemdev Did you try with actingAs() to make your request authenticable?
BTW, 401 means that somehow you are not authorized to perform this request.
Summer Sale! All accounts are 50% off this week.
Hi, I'm trying to run some tests and when it comes to the sanctum part, it always ends up with 401 code; my tests go with a model that is associated with the user model, for example, there is a user model and post owner model and I want to make tests on post owner model but it always wants an Authenticable and not a model, I even use hasApiToken trait but no luck, so is there any way to make it work with non-user model?
Thanks,
Please or to participate in this conversation.