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


PHP Flash::error方法代码示例

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


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

示例1: update

 /**
  * Update the role.
  * @return mixed
  */
 public function update($memberId, Request $request)
 {
     $member = Management::find($memberId);
     if ($member->status == 0) {
         foreach ($request->zone as $key => $zone) {
             $member->zone()->create(['zone' => $zone]);
         }
         $member->grade()->create(['grade' => $request->grade, 'number' => $request->number]);
         $member->status = 1;
         $member->save();
     } else {
         if ($member->status == 1) {
             $massage = "Already Approve";
         } else {
             $massage = "Reporter Not Found";
         }
         Flash::error($massage);
         return $this->redirect(handles('blupl/management::approval'));
     }
     Mailer::send('blupl/management::email.update', ['yoo' => 'Yoo'], function ($m) use($member) {
         $m->to($member->email);
         $m->from('info@accreditationbd.com');
         $m->subject('Thank you for your Registration');
     });
     Flash::success($member->name . ' Approved Successfully');
     return $this->redirect(handles('blupl/management::approval/all'));
 }
开发者ID:blupl,项目名称:management,代码行数:31,代码来源:ApprovalController.php

示例2: destroy

 public function destroy($medico_id)
 {
     $permiso = Permiso::find($medico_id);
     $permiso->delete();
     Flash::error('Permiso borrado con exito!');
     return redirect()->route('medico.permisos.index');
 }
开发者ID:rikardote,项目名称:agenda,代码行数:7,代码来源:PermisosController.php

示例3: handle

 /**
  * Check if user belongs to the specified role.
  *
  * @param Request      $request
  * @param Closure      $next
  * @param string|array $roles
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function handle(Request $request, Closure $next, $roles)
 {
     $accessDenied = true;
     if (!($user = $this->auth->getActiveUser())) {
         Flash::error(trans('dashboard::dashboard.flash.access_denied'));
         return redirect()->route('auth.login');
     }
     if (!is_array($roles)) {
         $roles = [$roles];
     }
     foreach ($roles as $role) {
         if (!($role = $this->role->getBySlug($role))) {
             continue;
         }
         if ($user->inRole($role)) {
             $accessDenied = false;
         }
     }
     if ($accessDenied) {
         Flash::error(trans('dashboard::dashboard.flash.access_denied'));
         // Redirect back to the previous page where request was made.
         return redirect()->back();
     }
     return $next($request);
 }
开发者ID:laraflock,项目名称:dashboard,代码行数:34,代码来源:RoleMiddleware.php

示例4: destroy

 public function destroy($id)
 {
     $especialidad = Especialidad::find($id);
     $especialidad->delete();
     Flash::error('La especialidad ' . $especialidad->name . ' ha sido borrada con exito!');
     return redirect()->route('especialidades.index');
 }
开发者ID:rikardote,项目名称:agenda,代码行数:7,代码来源:EspecialidadesController.php

示例5: destroy

 public function destroy(Request $request)
 {
     $model = Category::with('articles', 'announcements')->find($request->id);
     if (empty($model)) {
         Flash::error('Impossible de supprimer cette catégorie.');
         return Redirect::back();
     }
     $announcements = $model->announcements();
     $articles = $model->articles();
     if (!empty($announcements)) {
         foreach ($announcements as $a) {
             $a->update(['category_id' => 1]);
         }
     }
     if (!empty($articles)) {
         foreach ($articles as $a) {
             $a->update(['category_id' => 1]);
         }
     }
     $name = $model->name;
     $model->delete();
     makeModification('categories', 'The category « ' . $name . ' » has been removed.');
     Flash::success('La catégorie a bien été supprimé.');
     return Redirect::back();
 }
开发者ID:Techraav,项目名称:PolyMusic,代码行数:25,代码来源:CategoryController.php

示例6: destroy

 public function destroy($id)
 {
     $user = User::find($id);
     $user->delete();
     Flash::error('El usuario ' . $user->name . ' ha sido borrado con exito!');
     return redirect()->route('registrar.index');
 }
开发者ID:rikardote,项目名称:agenda,代码行数:7,代码来源:RegistroController.php

示例7: update

 /**
  * Update account information.
  *
  * @param \Illuminate\Http\Request $request
  * @param                          $id
  *
  * @return $this|\Illuminate\Http\RedirectResponse
  */
 public function update(Request $request, $id)
 {
     if ($request->input('action') == 'update_account') {
         try {
             $this->userRepositoryInterface->update($request->all(), $id);
         } catch (FormValidationException $e) {
             Flash::error($e->getMessage());
             return redirect()->route('account.edit')->withErrors($e->getErrors())->withInput();
         } catch (UsersException $e) {
             Flash::error($e->getMessage());
             return redirect()->route('dashboard.index');
         }
         Flash::success(trans('dashboard::dashboard.flash.account.success'));
         return redirect()->route('account.edit');
     }
     if ($request->input('action') == 'change_password') {
         try {
             $this->userRepositoryInterface->updatePassword($request->all());
         } catch (FormValidationException $e) {
             Flash::error($e->getMessage());
             return redirect()->route('account.edit')->withErrors($e->getErrors());
         } catch (AuthenticationException $e) {
             Flash::error(trans('dashboard::dashboard.flash.password.fail'));
             return redirect()->route('account.edit');
         }
         Flash::success(trans('dashboard::dashboard.flash.password.success'));
         return redirect()->route('account.edit');
     }
 }
开发者ID:laraflock,项目名称:dashboard,代码行数:37,代码来源:AccountController.php

示例8: destroy

 public function destroy($id)
 {
     $codigo = Cie::find($id);
     $codigo->delete();
     Flash::error('El Codigo ha sido borrado con exito!');
     return redirect()->route('codigos.index');
 }
开发者ID:rikardote,项目名称:agenda,代码行数:7,代码来源:CodigosController.php

示例9: destroy

 public function destroy($id)
 {
     $user = Userdoctor::find($id);
     $user->delete();
     Flash::error('El Medico ' . $user->Fullname . ' ha sido borrado con exito!');
     return redirect()->route('registrar_medicos.index');
 }
开发者ID:rikardote,项目名称:agenda,代码行数:7,代码来源:RegistroMedicosController.php

示例10: activateAccount

 /**
  * Attempt to activate an account
  *
  * @param string $confirmation_code
  * @return void
  */
 public function activateAccount($confirmation_code)
 {
     if (!$confirmation_code) {
         return redirect()->to('/');
     }
     $confirmation = AccountConfirmation::where('code', '=', $confirmation_code)->first();
     if ($confirmation == null) {
         Flash::error('Invalid confirmation code.');
         return redirect()->to('/');
     }
     $user = $confirmation->user;
     if ($user == null) {
         Flash::error('The user associated with this confirmation code either does not exist or has been deleted.');
         return redirect()->to('/');
     }
     if ($confirmation->hasExpired()) {
         Flash::error('That confirmation code has expired.');
         return redirect()->to('/');
     }
     if ($user->isConfirmed()) {
         Flash::error('The user associated with this confirmation code has already confirmed their account.');
         return redirect()->to('/');
     }
     $user->confirmed = 1;
     if ($user->save()) {
         Flash::success('Your account has been activated. You now have access to all the features that confirmed members get.');
         $confirmation->delete();
         return redirect()->to('/');
     } else {
         Flash::error('Your account could not be activated.');
         return redirect()->to('/');
     }
 }
开发者ID:fetch404,项目名称:fetch404,代码行数:39,代码来源:AccountController.php

示例11: destroy

 public function destroy($id)
 {
     $user = User::find($id);
     $user->delete();
     Flash::error('El usuario se ha elimindado');
     return redirect()->route('admin.users.index');
 }
开发者ID:eloyespeche,项目名称:BlogLaravel,代码行数:7,代码来源:UsersController.php

示例12: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $student = Auth::user();
     $course_id = $request["course_id"];
     $questions = Question::where('course_id', '=', $course_id)->get();
     if (count($questions) <= 0) {
         Flash::error('There was a problem processing your request.');
         return redirect()->route('registration.index');
     }
     $question_count = 0;
     $passed_count = 0;
     foreach ($questions as $que) {
         $question_count = $question_count + 1;
         $keyword_found = 0;
         $answer_array = explode(',', $que->answers);
         $students_reply_array = explode(' ', $request[$que->id]);
         $students_reply = $request[$que->id];
         foreach ($answer_array as $keyword) {
             if (strpos($students_reply, $keyword) !== false) {
                 $keyword_found = $keyword_found + 1;
             }
         }
         if ($keyword_found == count($answer_array)) {
             $passed_count = $passed_count + 1;
         }
     }
     $percent = $passed_count / $question_count * 100;
     Exam::create(['course_id' => $course_id, 'student_id' => $student->id, 'score_percentage' => $percent]);
     Flash::success('Answer sheet submitted successfully.');
     return redirect()->route('registration.index');
 }
开发者ID:omoprodigi,项目名称:Keyword-Matching-Exam,代码行数:37,代码来源:ExaminationController.php

示例13: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $periodo = Periodo::find($id);
     $periodo->delete();
     Flash::error('periodo borrado con exito!');
     return redirect()->route('periodos.index');
 }
开发者ID:rikardote,项目名称:sistem,代码行数:13,代码来源:PeriodosController.php

示例14: store

 public function store(Request $request)
 {
     $file = $request->file('file');
     $fileName = $request->input('file_name');
     $fileName = $fileName ?: $file->getClientOriginalName();
     $bulk = Bulk::create(['file_name' => $fileName]);
     if ($file->getClientMimeType() != "text/csv" && $file->getClientOriginalExtension() != "csv") {
         $bulk->result = "Invalid File Type";
         $bulk->mime_type = $file->getClientMimeType();
         $bulk->file_extension = $file->getClientOriginalExtension();
         $bulk->save();
         Flash::error('File type invalid.  Please use a CSV file format.');
         return redirect()->back();
     }
     $csvFile = new CsvFile($file);
     foreach ($csvFile as $row) {
         $indexArray[] = $row;
     }
     for ($i = 0; $i < count($indexArray); $i++) {
         $eraserArray[$i]['MAC'] = $indexArray[$i][0];
         $eraserArray[$i]['TLE'] = $indexArray[$i][1];
         $eraserArray[$i]['BULK_ID'] = $bulk->id;
     }
     $this->dispatch(new EraseTrustList($eraserArray));
     $bulk->result = "Processed";
     $bulk->mime_type = $file->getClientMimeType();
     $bulk->file_extension = $file->getClientOriginalExtension();
     $bulk->process_id = $fileName . '-' . Carbon::now()->timestamp;
     $bulk->save();
     $file->move(storage_path() . '/uploaded_files/', $fileName);
     Flash::success("File loaded successfully!  Check the Bulk Process table for progress on {$bulk->process_id}.");
     $bulks = Bulk::all();
     return view('bulk.index', compact('bulks'));
 }
开发者ID:shibahr,项目名称:uc-toolkit,代码行数:34,代码来源:BulkController.php

示例15: postPayment

 public function postPayment(PaymentFormRequest $request, $eventId, $attendeeId)
 {
     $registeredAttendee = $this->attendees->findById($attendeeId);
     $event = $this->events->findById($eventId);
     $input = $request->all();
     $token = $input['stripeToken'];
     if (empty($token)) {
         Flash::error('Your order could not be processed.  Please ensure javascript in enabled and try again.');
         return redirect()->back();
     }
     try {
         \Stripe\Stripe::setApiKey(env('STRIPE_SECRET'));
         $stripeCustomer = \Stripe\Customer::create(['source' => $token, 'description' => 'Stripe charge for AARMS customer: ' . $registeredAttendee->id, 'email' => $registeredAttendee->email]);
         $charge = \Stripe\Charge::create(['amount' => $event->price_cents, 'currency' => 'usd', 'customer' => $stripeCustomer->id, 'description' => 'Stripe charge for event: ' . $event->title]);
         if (!$charge) {
             Flash::error("Could not process Credit Card Payment");
             return redirect()->back();
         } else {
             $registeredAttendee->amount_paid = $event->price;
             $registeredAttendee->save();
             $sendMail = new SendInvoiceEmail($registeredAttendee);
             $this->dispatch($sendMail);
         }
         Flash::success("Payment successful!");
         return redirect()->back();
     } catch (\Stripe\Error\Card $e) {
         Flash::error($e->getMessage());
         return redirect()->back();
     }
 }
开发者ID:dirtyblankets,项目名称:allaccessrms,代码行数:30,代码来源:RegistrationPaymentController.php


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