本文整理汇总了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();
}
示例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']);
}
示例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();
}
示例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']);
}
示例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'));
}
示例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));
}
示例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();
}
示例8: noAccessReturn
/**
* {@inheritDocs}
*/
public function noAccessReturn($topic)
{
\Flash::danger(_("You don't have permission to lock topics."));
return $this->redirectToTopic($topic);
}
示例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]);
}
示例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();
}
}
示例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]);
}
示例12: noAccessReturn
/**
* {@inheritDocs}
*/
public function noAccessReturn($topic)
{
\Flash::danger(_('You have no glue to sticky this topic.'));
return $this->redirectToTopic($topic);
}
示例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]);
}
示例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);
}