本文整理匯總了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;
}
}