/**
  * Send a password reset link.
  *
  * @return Response
  */
 public function postEmail()
 {
     $this->confirmationForm->validate(Input::all());
     $this->mailer->sendPasswordResetLink(Input::only('email'));
     flash(true);
     return json(true);
 }
 /**
  * Resend the confirmation link.
  * 
  * @return Response
  */
 public function store()
 {
     $this->confirmationForm->validate(Input::all());
     $user = $this->userRepo->getByEmail(Input::get('email'));
     if ($user->confirmed) {
         return json(['errors' => trans('errors.confirmed')]);
     }
     $user->regenerateConfirmationToken();
     $this->mailer->sendConfirmationLink($user);
     flash(true);
     return json(true);
 }
 /**
  * @param  Comment $comment
  * @return void
  */
 public function onCommentCreated(Comment $comment)
 {
     if (!$comment->parent) {
         return false;
     }
     $to = $comment->parent->present()->authorEmail;
     if ($to === $comment->present()->authorEmail) {
         return false;
     }
     if ($comment->parent->user) {
         $comment->parent->user->notifications()->save(new Notification(['type' => Notification::TYPE_COMMENT, 'data' => $comment->id]));
         if (!$comment->parent->user->hasNotification('comment')) {
             return false;
         }
     }
     $this->mailer->sendCommentReply($to, $comment);
 }
Example #4
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::only('email', 'password', 'first_name', 'last_name', 'role_id', 'county_id');
     try {
         $this->createUserForm->validate($input);
     } catch (FormValidationException $e) {
         return back()->withInput()->withErrors($e->getErrors());
     }
     $password = $input['password'] ?: str_random(8);
     $user = User::create(['email' => $input['email'], 'password' => $password, 'first_name' => $input['first_name'], 'last_name' => $input['last_name'], 'role_id' => $input['role_id'], 'confirmed' => 1, 'county_id' => $input['county_id']]);
     if (Input::has('send_email')) {
         $this->mailer->sendAccount($user, $password);
     }
     flash('Utilizatorul <a href="' . route('admin.users.edit', $user->id) . "\">{$user->present()->fullName}</a> a fost adăugat cu succes.");
     return back();
 }