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


PHP Notifications::add方法代码示例

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


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

示例1: handleInProductionMode

 private function handleInProductionMode(Request $request, Exception $e)
 {
     if ($this->isQueryException($e)) {
         \Notifications::add('Update not allowed', 'danger', '0');
         return redirect()->back();
     }
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse([$this->getStatusCode($e) . ': ' . $e->getMessage()], $this->getStatusCode($e));
     }
     return response()->view('errors.500', ['exception' => $e], $this->getStatusCode($e));
 }
开发者ID:garf,项目名称:0ez,代码行数:11,代码来源:Handler.php

示例2: changePassword

 /**
  * Endpoint for changing the password.
  */
 public function changePassword(UserRequest $request)
 {
     // Get authenticated user
     $user = \Auth::user();
     // Get subset of actual input fields to consider
     $input = $request->getValidInputs();
     // Hash password
     $input['password'] = \Hash::make($input['password']);
     // Update user object
     $user->update($input);
     \Notifications::add('Your password has been changed.', 'success');
     if ($request->has('_redirect_url')) {
         return redirect($request->get('_redirect_url'));
     } else {
         return redirect()->route('user.settings');
     }
 }
开发者ID:Ravaelles,项目名称:Elder,代码行数:20,代码来源:UserController.php

示例3: Notifications

<?php

$pagetitle = "Request an Exam Token";
require_once "includes/header.php";
$n = new Notifications();
if (Input::exists()) {
    try {
        $rat = $user->data()->rating;
        if ($rat > 0 && $rat < 5) {
            $rating = $t->getRating(++$rat);
        }
        if (!$n->exists(1, $user->data()->id)) {
            $id = $n->add(array('type' => 1, 'from' => $user->data()->id, 'to_type' => 1, 'to' => 3, 'submitted' => date("Y-m-d H:i:s"), 'status' => 0));
            $comment = $n->addComment(array('notification_id' => $id, 'submitted' => date("Y-m-d H:i:s"), 'submitted_by' => 0, 'text' => '<p>ATSimTest Theory token requested.</p><p><strong>Next Rating: </strong>' . $rating->short . ' (' . $rating->long . ')</p><p><strong>Admin Link: </strong><a target="_blank" class="btn btn-xs btn-primary" href="https://www.atsimtest.com/index.php?cmd=admin&sub=memberdetail&memberid=' . $user->data()->id . '">ATSimTest</a></p>'));
            Session::flash('success', 'A theory token has been requested. Please allow 24 hours.');
            Redirect::to('./index.php');
        }
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
?>


<h3 class="text-center">My ATSimTest Token</h3><br>
	<div class="col-md-10 col-md-offset-1">
	<div class="panel panel-primary">
      <div class="panel-heading">ATSimTest Token</div>
      	<div class="panel-body text-center">
		
		
开发者ID:Ashilta,项目名称:VATeir,代码行数:29,代码来源:token.php


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