Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
webprofile-jwg2024
Commits
17319f53
Commit
17319f53
authored
Dec 22, 2021
by
Bagus Pambudi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
error handling 404 to home page
parent
444a890c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
app/Exceptions/Handler.php
+11
-0
composer.lock
+1
-1
No files found.
app/Exceptions/Handler.php
View file @
17319f53
...
@@ -4,6 +4,7 @@ namespace App\Exceptions;
...
@@ -4,6 +4,7 @@ namespace App\Exceptions;
use
Exception
;
use
Exception
;
use
Illuminate\Foundation\Exceptions\Handler
as
ExceptionHandler
;
use
Illuminate\Foundation\Exceptions\Handler
as
ExceptionHandler
;
use
Symfony\Component\HttpKernel\Exception\NotFoundHttpException
;
class
Handler
extends
ExceptionHandler
class
Handler
extends
ExceptionHandler
{
{
...
@@ -46,6 +47,16 @@ class Handler extends ExceptionHandler
...
@@ -46,6 +47,16 @@ class Handler extends ExceptionHandler
*/
*/
public
function
render
(
$request
,
Exception
$exception
)
public
function
render
(
$request
,
Exception
$exception
)
{
{
// You can add your own exception here
// so redirect to the home route
if
(
$exception
instanceof
NotFoundHttpException
)
{
return
redirect
(
'/'
);
}
return
parent
::
render
(
$request
,
$exception
);
return
parent
::
render
(
$request
,
$exception
);
}
}
}
}
composer.lock
View file @
17319f53
...
@@ -8306,5 +8306,5 @@
...
@@ -8306,5 +8306,5 @@
"php": "^7.1.3"
"php": "^7.1.3"
},
},
"platform-dev": [],
"platform-dev": [],
"plugin-api-version": "2.
1
.0"
"plugin-api-version": "2.
0
.0"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment