本文整理汇总了PHP中Illuminate\Support\Facades\Log::alert方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::alert方法的具体用法?PHP Log::alert怎么用?PHP Log::alert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Log
的用法示例。
在下文中一共展示了Log::alert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
public function login()
{
$response = $this->steam->validate();
Log::alert(json_encode($this->steam));
Log::alert(json_encode(\Config::get('steam-auth.api_key')));
if ($response) {
$info = $this->steam->getUserInfo();
if (!is_null($info)) {
$user = User::where('steam_id', $info->getSteamID64())->first();
if (!is_null($user)) {
Auth::login($user, true);
return redirect('/');
// redirect to site
} else {
$data = ['name' => $info->getNick(), 'steam_id' => $info->getSteamID64(), 'avatar' => $info->getProfilePictureFull()];
$user = User::create($data);
Auth::login($user, true);
return redirect('/');
// redirect to site
}
}
} else {
return $this->steam->redirect();
// redirect to Steam login page
}
}
示例2: registerPermissions
/**
* Register the permissions.
*
* @return bool
*/
public function registerPermissions()
{
try {
$this->getPermissions()->map(function ($permission) {
$this->gate->define($permission->name, function ($user) use($permission) {
return $user->hasPermissionTo($permission);
});
});
return true;
} catch (Exception $e) {
Log::alert('Could not register permissions');
return false;
}
}
示例3: destroy
/**
* Remove o usuário do aplicativo.
* @param $id
*/
public function destroy($id)
{
if ($id == null) {
abort(404);
}
$user = User::find($id);
if ($user->destroy($user->id)) {
unlink($user->avatar);
}
Log::alert("A conta do usuário {$user->name} foi excluida");
toast()->success("Conta excluida!");
return redirect()->to('/auth/login');
}
示例4: alert
/**
* Action must be taken immediately.
*
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
* @param string $message
* @param array $context
*
* @return bool
*/
public function alert($message, array $context = [])
{
return Log::alert($message, $context);
}
示例5: alert
/**
* @param $data
* @param array $contextualData
* @param array $location
*/
public static function alert($data, array $location = [], array $contextualData = [])
{
$msg = self::renderMessage($data, $location);
/** @noinspection PhpUndefinedMethodInspection */
BaseLog::alert($msg, $contextualData);
}