本文整理汇总了PHP中Notifier::notify方法的典型用法代码示例。如果您正苦于以下问题:PHP Notifier::notify方法的具体用法?PHP Notifier::notify怎么用?PHP Notifier::notify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notifier
的用法示例。
在下文中一共展示了Notifier::notify方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onShutdown
/**
* PHP shutdown handler that notifies Airbrake about shutdown. Should be
* used with register_shutdown_function.
*/
public function onShutdown()
{
$error = error_get_last();
if ($error === null) {
return;
}
if ($error['type'] & error_reporting() === 0) {
return;
}
$exc = new Errors\Fatal($error['message'], debug_backtrace());
$this->notifier->notify($exc);
}
示例2: notify
/**
* @see Notifier::notify()
* @param string $eventName
* @param array $params
* @return bool
*/
protected function notify($eventName, array $params = array())
{
return $this->eventNotifier->notify($eventName, $params);
}
示例3: success
/**
*
* @param string $message The message to print.
* @param string $page (optional) A specific admin page in which the
* notification should appear. If no page is specified
* the message will be visible in all admin pages.
*/
static function success($message, $page = null)
{
Notifier::notify($message, Notifier::SUCCESS, $page);
}
示例4: __call
public function __call($method, $args)
{
$event = $this->notifier->notify('call', array('method' => $method, 'args' => $args));
return call_user_func_array(array($this->object, $method), $event->getReturnValue($args));
}
示例5: notify
/**
* Alias for Notifier::notify.
*/
public static function notify($exc)
{
return self::$notifier->notify($exc);
}
示例6: function
<?php
use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;
Route::group(["prefix" => 'notifications'], function () {
Route::get('/', 'ffy\\notifications\\Http\\Controllers\\NotificationController@index');
Route::get('follow/{id}', 'ffy\\notifications\\Http\\Controllers\\NotificationController@follow');
Route::get('see/{id}', 'ffy\\notifications\\Http\\Controllers\\NotificationController@see');
Route::get('unsee/{id}', 'ffy\\notifications\\Http\\Controllers\\NotificationController@unsee');
// this is an example, please delete
Route::get('create', function () {
echo 'creating notification';
foreach (range(10, 50) as $item) {
$data = ['name' => 'Nikos', 'val' => rand(1, 1000)];
$rand_url = 'some_url_' . rand(0, 1000);
$type_id = rand(0, 1);
$user_id = 1;
$notification = Notifier::notify($user_id, $type_id, $data, $rand_url);
if (rand(0, 1)) {
$notification->seen = 1;
$notification->seen_at = Carbon::today()->subDays(rand(1, 400));
$notification->save();
}
}
echo "<br>done!";
});
});