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


PHP Flash::danger方法代码示例

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


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

示例1: postReport

 /**
  * Report post
  *
  * @return mixed
  */
 public function postReport()
 {
     if ($this->post->user_id == \Auth::user()->id) {
         \Flash::danger("Why would you report your own post?!", 'post-' . $this->post->id);
     } elseif ($this->reporter->report($this->post->id, \Auth::user()->id)) {
         \Flash::success('Thanks for reporting a post. Somebody with power will look at it soon ^_^.', 'post-' . $this->post->id);
     } else {
         \Flash::danger("You've already reported this post.", 'post-' . $this->post->id);
     }
     return $this->getShow();
 }
开发者ID:kaamaru,项目名称:laravel-forums,代码行数:16,代码来源:ReportPostsController.php

示例2: destroy

 public function destroy(DiscountFormRequest $request, $id)
 {
     $event = Event::find($request->input('event'));
     $discount = Discount::find($id);
     if ($discount && $event->user_id == $request->user()->id) {
         $discount->delete();
         \Flash::success('Discount deleted');
     } else {
         \Flash::danger('Sorry, permission denied');
     }
     //return redirect(action('EventsController@admin', $request->input('event')));
     return Redirect::back()->with(['tabName' => 'discounts']);
 }
开发者ID:rachelglover,项目名称:entries,代码行数:13,代码来源:DiscountController.php

示例3: getVote

 /**
  * Vote a post up or down
  *
  * @param int $postId
  * @param string $direction
  * @return \Illuminate\Http\RedirectResponse
  */
 public function getVote($topicType, $postId, $direction)
 {
     // Vote if does not own post
     if ($this->post->user_id != \Auth::user()->id) {
         // Vote post up
         if ($direction == 'up') {
             $this->voter->increment($postId, \Auth::user()->id);
         } elseif ($direction == 'down') {
             $this->voter->decrement($postId, \Auth::user()->id);
         }
     } else {
         Flash::danger(_('You cannot vote your own post!'), 'post-' . $postId);
     }
     return $this->getShow();
 }
开发者ID:kaamaru,项目名称:laravel-forums,代码行数:22,代码来源:VotePostsController.php

示例4: destroy

 /**
  * Delete an extra
  * @param Request $request
  * @param $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function destroy(Request $request, $id)
 {
     $event = Event::find($request->input('event'));
     $extra = Extra::find($id);
     if ($extra && $event->user_id == $request->user()->id) {
         $extra->delete();
         //Flash a message to the user
         \Flash::success('Extra deleted');
     } else {
         //Flash a message to the user
         \Flash::danger('Sorry, permission denied');
     }
     //Redirect back to the admin page
     //return redirect(action('EventsController@admin', $request->input('event')));
     return Redirect::back()->with(['tabName' => 'extras']);
 }
开发者ID:rachelglover,项目名称:entries,代码行数:22,代码来源:ExtrasController.php

示例5: destroy

 /**
  * @param Request $request
  * @param $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function destroy(Request $request, $slug)
 {
     //$event = Event::find($id);
     $event = Event::where('slug', '=', $slug)->firstOrFail();
     //Delete this event.
     if ($event && $event->user_id == $request->user()->id) {
         $event->delete();
         //Flash a message to the user
         \Flash::success('Event deleted');
     } else {
         //Flash a message to the user
         \Flash::danger('Sorry, permission denied');
     }
     //Redirect back to the admin page
     return redirect(action('PagesController@userEvents'));
 }
开发者ID:rachelglover,项目名称:entries,代码行数:21,代码来源:EventsController.php

示例6: destroy

 /**
  * Delete a detail
  * @param Request $request
  * @param $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function destroy(Request $request, $id)
 {
     $event = Event::find($request->input('event'));
     $detail = Detail::find($id);
     if ($detail && $event->user_id == $request->user()->id) {
         $detail->delete();
         //Flash a message to the user
         \Flash::success('Detail deleted');
     } else {
         //Flash a message to the user
         \Flash::danger('Sorry, permission denied');
     }
     $event = Event::findOrFail($request->input('event'));
     //Redirect back to the admin page
     return redirect(action('EventsController@admin', $event->slug));
 }
开发者ID:rachelglover,项目名称:entries,代码行数:22,代码来源:DetailController.php

示例7: cantEditPost

 /**
  * Can't edit post. Wrong permissions or not owner.
  */
 protected function cantEditPost()
 {
     Flash::danger(_("You can't edit this post."));
     return $this->redirectToTopic();
 }
开发者ID:kaamaru,项目名称:laravel-forums,代码行数:8,代码来源:EditPostsController.php

示例8: noAccessReturn

 /**
  * {@inheritDocs}
  */
 public function noAccessReturn($topic)
 {
     \Flash::danger(_("You don't have permission to lock topics."));
     return $this->redirectToTopic($topic);
 }
开发者ID:kaamaru,项目名称:laravel-forums,代码行数:8,代码来源:LockTopicsController.php

示例9: cantDeleteFirstPost

 /**
  * {@inheritDocs}
  */
 public function cantDeleteFirstPost()
 {
     Flash::danger(_("You can't delete the first post in a topic"));
     return Redirect::route('forums.posts.delete', ['topicType' => Route::current()->parameter('topicType'), 'post' => $this->post->id]);
 }
开发者ID:kaamaru,项目名称:laravel-forums,代码行数:8,代码来源:DeletePostsController.php

示例10: uploadAttachment

 function uploadAttachment()
 {
     $upload_rules = ['attachment' => 'required|mimes:doc,docx,pdf,txt,xls,xlsx'];
     $validator = \Validator::make($this->request->all(), $upload_rules);
     if ($validator->fails()) {
         return redirect()->back()->withErrors($validator)->withInput();
     }
     $application_id = $this->request->route('id');
     if ($this->request->hasFile('attachment') and $this->request->file('attachment')->isValid()) {
         $destinationPath = 'resources/uploads/attachments';
         // upload path
         $extension = $this->request->file('attachment')->getClientOriginalExtension();
         // get file extension
         $fileName = uniqid() . '_' . time() . '.' . $extension;
         $this->request->file('attachment')->move($destinationPath, $fileName);
         \Flash::success('File uploaded successfully!');
         $this->lead->uploadAttachment($application_id, $fileName);
         return redirect()->route('system.lead.accepted');
     } else {
         \Flash::danger('Uploaded file is not valid!');
         return redirect()->back();
     }
 }
开发者ID:KritaMaharjan,项目名称:expert,代码行数:23,代码来源:LeadController.php

示例11: noAccessReturn

 /**
  * {@inheritDocs}
  */
 public function noAccessReturn($topic)
 {
     \Flash::danger(_('You are not a qualified mover.'));
     return \Redirect::route('forums.topics.show', ['id' => $topic->id, 'slug' => $topic->slug]);
 }
开发者ID:kaamaru,项目名称:laravel-forums,代码行数:8,代码来源:MoveTopicsController.php

示例12: noAccessReturn

 /**
  * {@inheritDocs}
  */
 public function noAccessReturn($topic)
 {
     \Flash::danger(_('You have no glue to sticky this topic.'));
     return $this->redirectToTopic($topic);
 }
开发者ID:kaamaru,项目名称:laravel-forums,代码行数:8,代码来源:StickyTopicsController.php

示例13: noAccessReturn

 /**
  * {@inheritDocs}
  */
 public function noAccessReturn($topic)
 {
     Flash::danger(_("You can't delete this topic :/"));
     return Redirect::route('forums.topics.show', ['id' => $topic->id, 'slug' => $topic->slug]);
 }
开发者ID:kaamaru,项目名称:laravel-forums,代码行数:8,代码来源:DeleteTopicsController.php

示例14: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $request = Vimeo::request('/videos/' . $this->video->getVimeoId(), [], 'DELETE');
     if ($request['status'] != 204) {
         \Log::info('Verificar DELETE video ' . $this->video->getVimeoId() . 'en vimeo');
     }
     try {
         $this->video->delete();
         \Flash::info('Video eliminado correctamente');
     } catch (QueryException $e) {
         \Flash::danger('El video no se pudo eliminar');
     }
     return redirect()->route('protocols.show', $this->protocol);
 }
开发者ID:andrestntx,项目名称:Education,代码行数:20,代码来源:ProtocolVideosController.php


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