I believe you can add a method called registered to your Auth\RegisterController.
In the file vendor/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers there is a method called register which validates the request, fires a Registered event, logs in the user and then the last part looks like this:
return $this->registered($request, $user)
?: redirect($this->redirectPath());
So what it does is it checks if the return value of calling registered is truthy then it returns that, otherwise if it is non-truthy (which is the default because by default registered does nothing) then it redirects based on the redirectPath.
And the definition of redirectPath looks like this:
public function redirectPath()
{
if (method_exists($this, 'redirectTo')) {
return $this->redirectTo();
}
return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
}
So you can probably create the registered method as I said and make it look something like this:
<?php
class RegisterController extends Controller
{
use RegistersUsers;
protected $redirectTo = '/home';
protected function registered(Request $request, $user)
{
$request->session()->flash('foo', 'bar');
// Any other logic needed.
}
}
And if you want it to redirect after then make sure that you return false/null/nothing and define redirectTo as either a method or a property.
Sorry if this is not super clear or if I'm incorrect or if there are easier/better ways to achieve this or whatever, I'm brand new to Laravel.
EDIT: Typos fixed.