I've just upgraded from laravel 5.2.45 to 5.3.15 and, like many others out there, have some questions about how to implement passport and the default tables that come with the command:
php artisan make:auth
Situation 1:
I have set up my configuration to have 2 separate database connections. One is named 'core' (default connection) and the other is named 'auth'.
Question 1:
When I perform all the steps properly and migrate, all the tables populate in 1 database. I would like to get passport migrations into the auth database away from everything else. How can I achieve this?
Situation 2:
(Assume all config files have been set up correctly)
I managed to do this in the previous version of laravel (5.2) where I changed the users table to acct_user and got everything to work perfectly. Currently when I make the same necessary changes, and attempt to register a user, the user does not save in the database.
I've pulled out the code located in Illuminate\Foundation\Auth\RegistersUsers and overrode the trait's method inside of the RegisterController class located in App\Http\Controllers\Auth.
Code:
/**
* Handle a registration request for the application.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function register(Request $request)
{
$this->validator($request->all())->validate();
event(new Registered($user = $this->create($request->all())));
$this->guard()->login($user);
//return redirect($this->redirectPath());
//return $user;
}
The above code, from what I can gather, is directly responsible for handling registration requests and creating the user in the database. However, it keeps getting hung up inside of the event helper and keeps redirecting me and never creates the user. I've tried to comment out the return redirects throughout the class as well and apparently the redirect happens within the event helper itself. Bare in mind, for this I'm using Postman to make the request.
Question 2:
Am I doing something wrong here? How do I stop it from redirecting me and instead get it to simply return the user object?
Situation 3:
(Attempting to simulate a self-consuming application)
When I make a login or Register request through Postman with passport involved I'm expecting to get back a laravel_token cookie with the JWT embedded inside it.
Question 3:
Through Postman, how would I get this in the return?? or where would I look because currently I can't find it anywhere. Maybe I'm doing something wrong here too.
Any assistance is greatly appreciated.