Showing posts with label laravel 8 custom 404 page. Show all posts
Showing posts with label laravel 8 custom 404 page. Show all posts

Laravel 8 Custom Error Page Tutorial

how to create custom error page in laravel?

Hi Dev,

Today,I will learn you how engender Custom Error Page in laravel 8. we will show example of laravel 8 custom error page example . you will learn how to engender custom error page in laravel 8. you will learn how to engender 404 error page in laravel 8. we will avail you to give example of how to set 404 error page in laravel 8. if you optate to optically discern example of laravel 8 custom 404 page then you are a right place. Let's get commenced with laravel 8 incipient error page example.

You require to engender blade file like 404.blade.php, 405.blade.php etc on errors(resources/view.errors) directory in laravel 8. you can optically discern i engendered 404 blade file and check it on your project.

Virtually we are utilizing theme for front-end or backend side and we always probing for set 404, 500 or 505 error page design from there that we utilized for project. So it is a very simple and facile way to engender custom 404 page in laravel 8 project. i integrated below screen shot of laravel 8 error page design.

Now you have to just engender "errors" folder in your resources directory and then after you require to engender 404.blade.file inside that folder. So, fundamentally laravel 8 will stetted default design, but if you engendered 404 file into "errors" directory then it will take from there

So, you just need to engender 404 blade file and put your own code like i integrated then you can simply check it out.

resources/views/errors/404.blade.php
<!DOCTYPE html>
<html>
<head>
   <title>Custom Error Page</title>
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css">
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" ></script>
    <style type="text/css">
       .error-div{
          margin-top: 200px;
          background: #c1c1c1;
          padding: 70px;
          border-radius: 5px;
       }
       .error-div h1{
          font-size: 50px;
         font-weight: bold;          
       }
       .error-div h6{
          font-family: ubuntu;
          font-size: 20px;
       }
    </style>
</head>
<body>
   <div class="container">
      <div class="row text-center">
        <div class="col-md-6 offset-md-3 error-div">
          <h1>404</h1>
          <h6>Page not found - Itwebtuts.com</h6>
        </div>
      </div>
    </div>
</body>
</html>

After you can simply run your application by following command:

php artisan serve

Now you can open following url and you will see error page as above:

http://localhost:8000/okgays

Now you can simply check it out.

Output

I will help you...