title: Laravel 5.2 send password reset after registration
body: <p>I have altered my authController.php file to do a few things needed for my project. It works great, just need to make one more change. Right now the controller looks like this:</p>
  
  <pre><code>    &lt;?php
  
  namespace App\Http\Controllers\Auth;
  
  use App\User;
  use App\Role;
  use Mail;
  use Validator;
  use App\Http\Controllers\Controller;
  use Illuminate\Foundation\Auth\ThrottlesLogins;
  use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
  use Illuminate\Http\Request;
  
  use Illuminate\Foundation\Auth\ResetsPasswords;
  
  class AuthController extends Controller
  {
      /*
      |--------------------------------------------------------------------------
      | Registration &amp; Login Controller
      |--------------------------------------------------------------------------
      |
      | This controller handles the registration of new users, as well as the
      | authentication of existing users. By default, this controller uses
      | a simple trait to add these behaviors. Why don't you explore it?
      |
      */
  
      use AuthenticatesAndRegistersUsers, ThrottlesLogins, ResetsPasswords;
  
      /**
       * Where to redirect users after login / registration.
       *
       * @var string
       */
      protected $redirectTo = '/add';
  
      /**
       * Create a new authentication controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware($this-&gt;guestMiddleware(), ['except' =&gt; 'logout']);
  
  
      }
  
  
       /**
       * Overwrite the Laravel 5.2 standard registration 
       * so user will not be logged in automatically.
       *
       * @param  array  $request
       * @return Register
       */
      public function register(Request $request)
      {
          $validator = $this-&gt;validator($request-&gt;all());
  
          if ($validator-&gt;fails()) {
              $this-&gt;throwValidationException(
                  $request, $validator
              );
          }
  
          $this-&gt;create($request-&gt;all());
  
          return redirect($this-&gt;redirectPath());
      }
  
      /**
       * Extend password reset email to user for when registering
       */
  
      public function sendResetLinkEmail(Request $request)
      {
          $this-&gt;validateSendResetLinkEmail($request);
  
          $broker = $this-&gt;getBroker();
  
          $this-&gt;subject = "First Time User Setup";
          $broker-&gt;emailView = "auth.emails.password";
  
          $response = Password::broker($broker)-&gt;sendFirstTimeSetup(
              $this-&gt;getSendResetLinkEmailCredentials($request),
              $this-&gt;resetEmailBuilder()
          );
  
          switch ($response) {
              case Password::RESET_LINK_SENT:
                  return $this-&gt;getSendResetLinkEmailSuccessResponse($response);
              case Password::FIRST_TIME_SETUP:
                  return $this-&gt;getSendFirstTimeSetupEmailSuccessResponse($response);
              case Password::INVALID_USER:
              default:
                  return $this-&gt;getSendResetLinkEmailFailureResponse($response);
          }
      }
  
      public function getSendFirstTimeSetupEmailSuccessResponse($response) 
      {
          return redirect()-&gt;back()-&gt;with('status', trans($response));
      }
  
  
      /**
       * Get a validator for an incoming registration request.
       *
       * @param  array  $data
       * @return \Illuminate\Contracts\Validation\Validator
       */
      protected function validator(array $data)
      {
          return Validator::make($data, [
              'first-name' =&gt; 'required|max:255',
              'last-name' =&gt; 'required|max:255',
              'phone' =&gt; 'required|max:255',
              'form' =&gt; 'max:255',
              'email' =&gt; 'required|email|max:255|unique:users',
              'password' =&gt; 'required|min:6|confirmed',
          ]);
      }
  
      /**
       * Create a new user instance after a valid registration.
       *
       * @param  array  $data
       * @return User
       */
      protected function create(Request $request,  array $data ) 
      {
          //Create the user
          $user = User::create([
              'first_name' =&gt; $data['first-name'],
              'last_name' =&gt; $data['last-name'],
              'phone' =&gt; $data['phone'],
              'email' =&gt; $data['email'],
              'password' =&gt; bcrypt($data['password']),
          ]);
  
          return $this-&gt;postEmail($request);
  
          /*
          Mail::send('auth.emails.registered', ['user' =&gt; $user], function ($m) use ($user) 
          {
              $m-&gt;to($user-&gt;email, $user-&gt;first_name)-&gt;subject('You Have Been Added');
          });*/
  
          //Is it a User? Then give them that role
          if ($data['user-role'] == 'user')
          {
              $role = Role::where('name', '=', 'user')-&gt;firstOrFail();
              $user = User::find($user-&gt;id);
              $user-&gt;roles()-&gt;attach($role-&gt;id);
          }
  
          //Is it an Admin? Then give them that role
          if ($data['user-role'] == 'admin')
          {
              $role = Role::where('name', '=', 'owner')-&gt;firstOrFail();
              $user = User::find($user-&gt;id);
              $user-&gt;roles()-&gt;attach($role-&gt;id);
          }
  
          return $user;
      }
  
  
  
  
  
  }
  </code></pre>
  
  <p>It stops auto login on user creation, assigns a role to the user based on the form and sends a password reset email. The trouble is not I get the error <code>Trait method guestMiddleware has not been applied, because there are collisions with other trait methods on App\Http\Controllers\Auth\AuthController
  </code></p>