本文整理汇总了PHP中Alert::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Alert::all方法的具体用法?PHP Alert::all怎么用?PHP Alert::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alert
的用法示例。
在下文中一共展示了Alert::all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public function get($id = null)
{
$search = Input::get('search');
if (Auth::user()->profile_type == 'admin') {
$users = User::withTrashed()->where(DB::raw('CONCAT(last_name," ",name)'), 'like', '%' . $search . '%')->orwhere(DB::raw('CONCAT(name," ",last_name)'), 'like', '%' . $search . '%')->orderBy('last_name')->paginate(15);
} else {
$users = User::where('id', Auth::user()->id)->paginate(15);
}
$selectedUser = self::__checkExistence($id);
if (!$selectedUser) {
$selectedUser = new User();
}
$alerts = Alert::all();
$selectedUserAlerts = array();
if ($selectedUser->id) {
$pivotData = $selectedUser->alerts;
foreach ($pivotData as $current) {
$selectedUserAlerts[$current->pivot->alerts_id]['fb'] = $current->pivot->to_facebook;
$selectedUserAlerts[$current->pivot->alerts_id]['mail'] = $current->pivot->to_email;
$selectedUserAlerts[$current->pivot->alerts_id]['sms'] = $current->pivot->to_sms;
}
}
return View::make('alerts.main')->with('usersId', $id)->with('selectedUserAlerts', $selectedUserAlerts)->with('selectedUser', $selectedUser)->with('users', $users)->with('search', $search)->with('alerts', $alerts);
}
示例2: showAlert
/**
* Show alert wrapper
*
* @return string Alert message
*/
public function showAlert()
{
$format = $this->system('alert_tpl');
foreach (\Alert::all($format) as $alert) {
return $alert;
}
}