title: Registering User with Laravel Passport
body: <p>I set up password grant (it's backend for an app). Now, I can send a post request to <code>oauth/token</code> and it works on Postman. However, what if I want to register user from the api too?</p>
  
  <p>I understand I can use current <code>/register</code> route, however, then will I need to redirect the user back to the login page and he logs in again with his credentials? </p>
  
  <p>Or in the RegisterController, in <code>registered()</code> function, should I do I redirect to the <code>oauth/token</code> route? (For this, please note that I am sending, all the 5 data in 'x-www-form-urlencoded' and it seems to work. However, do I need to separate some in headers? It's blurry for me, so just wanted to ask when I have the chance).</p>
  
  <p>Or should I add something in the <code>oauth/token</code> method like <a href="https://laracasts.com/discuss/channels/laravel/how-to-register-a-user-through-laravel-passport/replies/340022" rel="noreferrer">this guy</a>? Actually, I tried to catch the posted <code>$request</code> data on <code>AccessTokenController@issueToken</code>method inside library, however I couldn't figure out how to manipulate the <code>parsedBody</code> array. If I trigger my register function from the actual library, how would I know if it's register or login?</p>
  
  <p>Maybe I am missing out some information, but I couldn't find anything based on this topic. What is the proper way of handling registering user in Passport?</p>
  
  <hr>
  
  <p><strong>Update:</strong> Accepted answer shows the 'register' cycle; and below it I have added 'login' and 'refresh token' implementations. Hope it helps :)</p>