-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move HTTP default error pages into framework.
- Loading branch information
1 parent
730daa7
commit 855a8aa
Showing
2 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,8 +186,13 @@ protected function renderHttpException(HttpException $e) | |
{ | ||
$status = $e->getStatusCode(); | ||
|
||
if (view()->exists("errors.{$status}")) { | ||
return response()->view("errors.{$status}", ['exception' => $e], $status, $e->getHeaders()); | ||
view()->replaceNamespace('errors', [ | ||
resource_path('views/errors'), | ||
__DIR__.'/views', | ||
]); | ||
|
||
if (view()->exists("errors::{$status}")) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
brunogaspar
Contributor
|
||
return response()->view("errors::{$status}", ['exception' => $e], $status, $e->getHeaders()); | ||
} else { | ||
return $this->convertExceptionToResponse($e); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<title>Laravel</title> | ||
This comment has been minimized.
Sorry, something went wrong.
kduma
Contributor
|
||
|
||
<!-- Fonts --> | ||
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css"> | ||
|
||
<!-- Styles --> | ||
<style> | ||
html, body { | ||
background-color: #fff; | ||
color: #636b6f; | ||
font-family: 'Raleway', sans-serif; | ||
font-weight: 100; | ||
height: 100vh; | ||
margin: 0; | ||
} | ||
.full-height { | ||
height: 100vh; | ||
} | ||
.flex-center { | ||
align-items: center; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
.position-ref { | ||
position: relative; | ||
} | ||
.top-right { | ||
position: absolute; | ||
right: 10px; | ||
top: 18px; | ||
} | ||
.content { | ||
text-align: center; | ||
} | ||
.title { | ||
font-size: 84px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="flex-center position-ref full-height"> | ||
<div class="content"> | ||
<div class="title"> | ||
Be right back. | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Is this
::
notation described anywhere in the current documentation? If not, I'm happy to do a PR.Related: #20953