1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Mail;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Mail\Mailable;
- use Illuminate\Queue\SerializesModels;
- use App\User;
- class SupervisorPasswordResetLink extends Mailable
- {
- use Queueable, SerializesModels;
- public $supervisor, $info;
- public function __construct(User $supervisor)
- {
- $this->supervisor=$supervisor;
- $this->info['header']="Set a New Password";
- $this->info['token']=app('auth.password.broker')->createToken($supervisor);
- \DB::table('password_resets')->updateOrInsert(
- ['email' => $supervisor->email], [
- 'token' => bcrypt($this->info['token']),
- 'created_at'=>now()
- ]
- );
- }
- /**
- * Build the message.
- *
- * @return $this
- */
- public function build()
- {
- return $this->from(
- "asraful@revinr.com"
- )->view(
- 'email.supervisor_password_reset_link'
- )->subject('Password Reset Request: Set a New Password');
- }
- }
|