0👍
✅
your register method of the controller is not accessible because of the auth
middleware. so you are getting not authorized error. make it accessible without authorization. in the constructor method of the controller change this line like below.
$this->middleware('auth:api', ['except' => ['login', 'register']]);
login
andregister
are controller’s method which will be now accessible without authorization.
Source:stackexchange.com