/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }
/** * Send a test notification * * @return Redirect */ public function sendTestNotification() { $user = User::find(Auth::id()); // If user found if ($user) { if ($user->pushbullet_api_key && $user->pushbullet_device) { // If api key and device are defined $pushbullet = new PHPushbullet($user->pushbullet_api_key); $message = 'This is a test notification from Mail Tracker'; $pushbullet->device($user->pushbullet_device)->note('Mail Tracker', $message); Session::flash('pushbullet_info', 'Test notification sent to ' . $user->pushbullet_device . '!'); } else { Session::flash('pushbullet_error', 'Please verify Pushbullet settings.'); } } // Return to user profile return Redirect::action('Admin\\AdminUserController@edit'); }