Skip to content

Commit

Permalink
Merge pull request #47 from Laravel-Backpack/error-pages
Browse files Browse the repository at this point in the history
Added error pages
  • Loading branch information
pxpm authored Sep 19, 2023
2 parents 74b7487 + f971c57 commit 694f499
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"Laravel", "Backpack", "Backpack for Laravel", "Backpack Addon", "ThemeCoreuiv4"
],
"require": {
"backpack/crud": "^6.2"
"backpack/crud": "^6.2.1"
},
"require-dev": {
"phpunit/phpunit": "~9.0",
Expand Down
14 changes: 14 additions & 0 deletions resources/views/errors/blank.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ trans('backpack::base.error_page.title', ['error' => $error_number]) }}</title>

@include(backpack_view('inc.theme_styles'))
@include(backpack_view('inc.styles'))
</head>
<body>
@yield('content')
</body>
</html>
23 changes: 23 additions & 0 deletions resources/views/errors/layout.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@extends(backpack_view(backpack_user() && backpack_theme_config('layout') ? 'layouts.'.backpack_theme_config('layout') : 'errors.blank'))

@section('content')
<div class="d-flex align-items-center" style="height: calc(100vh - 7rem)">
<div class="container">
<div class="col-md-6 m-auto">
<div class="d-flex justify-content-center">
<h1 class="display-2 mb-0 me-4">{{ $error_number }}</h1>
<div>
<h4 class="pt-3">@yield('title')</h4>
<p class="text-medium-emphasis">@yield('description')</p>
<div class="empty-action">
<a href="./." class="btn btn-primary">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M5 12l14 0"></path><path d="M5 12l6 6"></path><path d="M5 12l6 -6"></path></svg>
{{ trans('backpack::base.error_page.button') }}
</a>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

0 comments on commit 694f499

Please sign in to comment.