当前位置: 首页>>代码示例>>PHP>>正文


PHP Notification::success方法代码示例

本文整理汇总了PHP中Notification::success方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::success方法的具体用法?PHP Notification::success怎么用?PHP Notification::success使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notification的用法示例。


在下文中一共展示了Notification::success方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $fob = KeyFob::findOrFail($id);
     $fob->markLost();
     \Notification::success("Key Fob marked as lost/broken");
     return \Redirect::route('account.show', $fob->user_id);
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:13,代码来源:KeyFobController.php

示例2: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request)
 {
     $this->repository->update($request->only('name'), auth()->user()->getAuthIdentifier());
     $this->repository->updateProfile($request->except('_token'), auth()->user()->getAuthIdentifier());
     \Notification::success(trans('users.flash.profile_updated'));
     return redirect()->back();
 }
开发者ID:laravolt,项目名称:foundation,代码行数:13,代码来源:ProfileController.php

示例3: store

 /**
  * Start the creation of a new gocardless payment
  *   Details get posted into this method and the redirected to gocardless
  * @param $userId
  * @throws \BB\Exceptions\AuthenticationException
  * @throws \BB\Exceptions\FormValidationException
  * @throws \BB\Exceptions\NotImplementedException
  */
 public function store($userId)
 {
     User::findWithPermission($userId);
     $requestData = \Request::only(['reason', 'amount', 'return_path', 'stripeToken', 'ref']);
     $stripeToken = $requestData['stripeToken'];
     $amount = $requestData['amount'];
     $reason = $requestData['reason'];
     $returnPath = $requestData['return_path'];
     $ref = $requestData['ref'];
     try {
         $charge = Stripe_Charge::create(array("amount" => $amount, "currency" => "gbp", "card" => $stripeToken, "description" => $reason));
     } catch (\Exception $e) {
         \Log::error($e);
         if (\Request::wantsJson()) {
             return \Response::json(['error' => 'There was an error confirming your payment'], 400);
         }
         \Notification::error("There was an error confirming your payment");
         return \Redirect::to($returnPath);
     }
     //Replace the amount with the one from the charge, this prevents issues with variable tempering
     $amount = $charge->amount / 100;
     //Stripe don't provide us with the fee so this should be OK
     $fee = $amount * 0.024 + 0.2;
     $this->paymentRepository->recordPayment($reason, $userId, 'stripe', $charge->id, $amount, 'paid', $fee, $ref);
     if (\Request::wantsJson()) {
         return \Response::json(['message' => 'Payment made']);
     }
     \Notification::success("Payment made");
     return \Redirect::to($returnPath);
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:38,代码来源:StripePaymentController.php

示例4: update

 public function update(UpdatePassword $request)
 {
     $user = auth()->user();
     $this->repository->updatePassword($request->get('password'), $user->id);
     \Notification::success(trans('users.flash.password_updated'));
     return redirect()->back();
 }
开发者ID:laravolt,项目名称:foundation,代码行数:7,代码来源:PasswordController.php

示例5: update

 public function update($userId)
 {
     //Verify the user can access this user record - we don't need the record just the auth check
     $user = User::findWithPermission($userId);
     $input = \Input::all();
     //Clear the profile photo field as this is handled separately below.
     unset($input['new_profile_photo']);
     if (empty($input['profile_photo_private'])) {
         $input['profile_photo_private'] = false;
     }
     //Trim all the data so some of the validation doesn't choke on spaces
     foreach ($input as $key => $value) {
         if (is_string($value)) {
             $input[$key] = trim($value);
         }
     }
     $this->profileValidator->validate($input, $userId);
     $this->profileRepo->update($userId, $input);
     if (\Input::file('new_profile_photo')) {
         try {
             $this->userImage->uploadPhoto($user->hash, \Input::file('new_profile_photo')->getRealPath(), true);
             $this->profileRepo->update($userId, ['new_profile_photo' => 1]);
             \Notification::success("Photo uploaded, it will be checked and appear shortly");
         } catch (\Exception $e) {
             \Log::error($e);
         }
     } else {
         \Notification::success("Profile Updated");
     }
     return \Redirect::route('members.show', $userId);
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:31,代码来源:ProfileController.php

示例6: store

 /**
  * Start the creation of a new balance payment
  *   Details get posted into this method
  * @param $userId
  * @throws \BB\Exceptions\AuthenticationException
  * @throws \BB\Exceptions\FormValidationException
  * @throws \BB\Exceptions\NotImplementedException
  */
 public function store($userId)
 {
     $user = User::findWithPermission($userId);
     $this->bbCredit->setUserId($user->id);
     $requestData = \Request::only(['reason', 'amount', 'return_path', 'ref']);
     $amount = $requestData['amount'] * 1 / 100;
     $reason = $requestData['reason'];
     $returnPath = $requestData['return_path'];
     $ref = $requestData['ref'];
     //Can the users balance go below 0
     $minimumBalance = $this->bbCredit->acceptableNegativeBalance($reason);
     //What is the users balance
     $userBalance = $this->bbCredit->getBalance();
     //With this payment will the users balance go to low?
     if ($userBalance - $amount < $minimumBalance) {
         if (\Request::wantsJson()) {
             return \Response::json(['error' => 'You don\'t have the money for this'], 400);
         }
         \Notification::error("You don't have the money for this");
         return \Redirect::to($returnPath);
     }
     //Everything looks gooc, create the payment
     $this->paymentRepository->recordPayment($reason, $userId, 'balance', '', $amount, 'paid', 0, $ref);
     //Update the users cached balance
     $this->bbCredit->recalculate();
     if (\Request::wantsJson()) {
         return \Response::json(['message' => 'Payment made']);
     }
     \Notification::success("Payment made");
     return \Redirect::to($returnPath);
 }
开发者ID:paters936,项目名称:BBMembershipSystem,代码行数:39,代码来源:BalancePaymentController.php

示例7: update

 public function update($logEntryId)
 {
     $reason = \Request::get('reason');
     if (!in_array($reason, ['training', 'testing'])) {
         throw new \BB\Exceptions\ValidationException("Not a valid reason");
     }
     $equipmentLog = $this->equipmentLogRepository->getById($logEntryId);
     /*
     if ($equipmentLog->user_id == \Auth::user()->id) {
         throw new \BB\Exceptions\ValidationException("You can't update your own record");
     }
     */
     if (!\Auth::user()->hasRole($equipmentLog->device) && !\Auth::user()->isAdmin()) {
         throw new \BB\Exceptions\ValidationException("You don't have permission to alter this record");
     }
     if (!empty($equipmentLog->reason)) {
         throw new \BB\Exceptions\ValidationException("Reason already set");
     }
     $billedStatus = $equipmentLog->billed;
     if ($equipmentLog->billed) {
         //the user has been billed, we need to undo this.
         $payments = $this->paymentRepository->getPaymentsByReference($equipmentLog->id . ':' . $equipmentLog->device);
         if ($payments->count() == 1) {
             $this->paymentRepository->delete($payments->first()->id);
             $billedStatus = false;
         } else {
             throw new \BB\Exceptions\ValidationException("Unable to locate related payment, please contact an admin");
         }
     }
     $this->equipmentLogRepository->update($logEntryId, ['reason' => $reason, 'billed' => $billedStatus]);
     \Notification::success("Record Updated");
     return \Redirect::back();
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:33,代码来源:EquipmentLogController.php

示例8: store

 public function store()
 {
     $input = \Input::only('subject', 'message', 'send_to_all', 'recipient');
     $this->emailNotificationValidator->validate($input);
     //This is for admins only unless they are part of a group, then they have access to specific lists
     if (!\Auth::user()->isAdmin() && !\Auth::user()->hasRole('laser')) {
     }
     if ($input['send_to_all']) {
         if ($input['recipient'] == 'all') {
             if (!\Auth::user()->isAdmin()) {
                 throw new AuthenticationException("You don't have permission to send to this group");
             }
             $users = $this->userRepository->getActive();
         } else {
             if ($input['recipient'] == 'laser_induction_members') {
                 if (!\Auth::user()->hasRole('laser')) {
                     throw new AuthenticationException("You don't have permission to send to this group");
                 }
                 $users = $this->inductionRepository->getUsersForEquipment('laser');
             } else {
                 throw new NotImplementedException("Recipient not supported");
             }
         }
         foreach ($users as $user) {
             $notification = new UserMailer($user);
             $notification->sendNotificationEmail($input['subject'], nl2br($input['message']));
         }
     } else {
         //Just send to the current user
         $notification = new UserMailer(\Auth::user());
         $notification->sendNotificationEmail($input['subject'], nl2br($input['message']));
     }
     \Notification::success('Email Queued to Send');
     return \Redirect::route('notificationemail.create');
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:35,代码来源:NotificationEmailController.php

示例9: cancelUpload

 public function cancelUpload()
 {
     if (unlink($this->uploadedFile["tmp_name"])) {
         Notification::success(1, 'File upload was canceled.');
         return true;
     } else {
         return false;
     }
 }
开发者ID:ashmna,项目名称:MedDocs,代码行数:9,代码来源:FileUpload.php

示例10: activate

 /**
  * Show the form for editing the specified resource.
  *
  * @param Email $email
  * @param $token
  * @return \Illuminate\Http\Response
  */
 public function activate(Email $email, $token)
 {
     if ($email->activate($token, auth()->user())) {
         \Notification::success(trans('email::email.activation_success'));
     } else {
         \Notification::error(trans('email::email.activation_failed'));
     }
     return redirect($this->redirectPath());
 }
开发者ID:javanlabs,项目名称:siparti,代码行数:16,代码来源:EmailController.php

示例11: update

 /**
  * Update the specified user in storage.
  *
  * @param  \Illuminate\Http\Request     $request
  * @param  \App\User                    $user
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, User $user)
 {
     $user->update($request->except('biography', 'contactDetails', 'address'));
     $user->biography()->updateOrCreate([], $request->biography);
     $user->contactDetails()->updateOrCreate([], $request->contactDetails);
     $user->profile()->updateOrCreate([], $request->profile);
     $user->address()->updateOrCreate([], $request->address);
     \Notification::success("Künstler erfolgreich aktualisiert.");
     return back();
 }
开发者ID:LichtAnd,项目名称:nkg,代码行数:17,代码来源:UserController.php

示例12: approve

 /**
  * Action the admin approve requests
  *
  * @param $id
  *
  * @return mixed
  * @throws \BB\Exceptions\AuthenticationException
  */
 public function approve($id)
 {
     $user = User::findWithPermission($id, 'comms');
     if (\Input::has('inducted_by')) {
         $user->inducted_by = \Auth::id();
         $user->save();
         \Notification::success('Updated');
     }
     return \Redirect::route('account.induction.index');
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:18,代码来源:MemberInductionController.php

示例13: update

 /**
  * Update the specified resource in storage.
  *
  * @param      $userId
  * @param  int $id
  * @throws \BB\Exceptions\NotImplementedException
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update($userId, $id)
 {
     $induction = Induction::findOrFail($id);
     if (\Input::get('mark_trained', false)) {
         $induction->trained = \Carbon\Carbon::now();
         $induction->trainer_user_id = \Input::get('trainer_user_id', false);
         $induction->save();
     } elseif (\Input::get('is_trainer', false)) {
         $induction->is_trainer = true;
         $induction->save();
     } else {
         throw new \BB\Exceptions\NotImplementedException();
     }
     \Notification::success("Updated");
     return \Redirect::route('account.show', $userId);
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:24,代码来源:InductionController.php

示例14: destroy

 /**
  * Remove cash from the users balance
  *
  * @param $userId
  * @return mixed
  * @throws \BB\Exceptions\AuthenticationException
  * @throws \BB\Exceptions\InvalidDataException
  */
 public function destroy($userId)
 {
     $user = User::findWithPermission($userId);
     $this->bbCredit->setUserId($userId);
     $amount = \Request::get('amount');
     $returnPath = \Request::get('return_path');
     $ref = \Request::get('ref');
     $minimumBalance = $this->bbCredit->acceptableNegativeBalance('withdrawal');
     if ($user->cash_balance + $minimumBalance * 100 < $amount * 100) {
         \Notification::error("Not enough money");
         return \Redirect::to($returnPath);
     }
     $this->paymentRepository->recordPayment('withdrawal', $userId, 'balance', '', $amount, 'paid', 0, $ref);
     $this->bbCredit->recalculate();
     \Notification::success("Payment recorded");
     return \Redirect::to($returnPath);
 }
开发者ID:paters936,项目名称:BBMembershipSystem,代码行数:25,代码来源:CashPaymentController.php

示例15: post

 public function post()
 {
     $contact = $this->contact->first();
     if (!is_null($contact)) {
         $id = $contact->id;
         $contact = $this->contact->find($id);
         $contact->phone = \Input::get('phone');
         $contact->email = \Input::get('email');
         $contact->address = \Input::get('address');
         $contact->map = json_encode(explode(',', trim(\Input::get('map'))));
         $contact->show = 1;
         $contact->save();
     } else {
         $data = array('phone' => \Input::get('phone'), 'email' => \Input::get('email'), 'address' => \Input::get('address'), 'map' => \Input::get('map'), 'show' => 1);
         $this->contact->create($data);
     }
     \Notification::success('Done !');
     return \Redirect::back();
 }
开发者ID:minhliem86,项目名称:liemphan-cms,代码行数:19,代码来源:ContactController.php


注:本文中的Notification::success方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。