/** * Execute the command. * * @return void */ public function handle() { $phone = VerifiedPhoneNumber::where('verify_token', $this->token)->first(); if ($phone && Carbon::now() <= $phone->expires_at) { $phone->verified_at = Carbon::now(); $phone->verified = true; $phone->save(); return true; } return false; }
public function getSendVerificationToken($user, $id) { $this->dispatch(new SendVerificationForPhone(VerifiedPhoneNumber::findOrFail($id))); flash()->success('Message sent! Wait a bit!'); return redirect()->back(); }
/** * Execute the command. * * @return void */ public function handle() { $util = PhoneNumberUtil::getInstance(); $num = $util->parse($this->number, $this->country); return VerifiedPhoneNumber::create(['user_id' => $this->user->id, 'country' => $this->country, 'country_prefix' => $num->getCountryCode(), 'phone_number' => $num->getNationalNumber()]); }