Hello,
I have tried to securize an API with Passport with this tutorial.
I have created an API Resource like in this tutorial :
https://www.twilio.com/blog/build-secure-api-php-laravel-passport
When I register a new account, the application does not returns the token, but it returns an HTML page.
Here is the code for my resource.
public function toArray($request)
{
return parent::toArray($request);
}
And here is the return code of my controller.
return response([
'ceo' => new CEOResource($ceos),
'message' => 'Created successfully'
], 200);
I wonder why it returns me an HTML page instead of an array.
Do you have any idea ?
Thank you for your answer.
Vincent