Laravel

Laravel 6 Custom Error Page

Pinterest LinkedIn Tumblr

Today, I am going to show you how to create a custom 404 page in laravel 7.
First, you need to create a page inside of resources/views/errors/404.blade.php
Now, Code inside of 404.blade.php

<!DOCTYPE html>
<html lang="en">
<head>
    <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">
       *{
    transition: all 0.6s;
    }

    html {
        height: 100%;
    }

    body{
        font-family: 'Lato', sans-serif;
        color: #888;
        margin: 0;
    }

    #main{
        display: table;
        width: 100%;
        height: 100vh;
        text-align: center;
    }

    .fof{
        display: table-cell;
        vertical-align: middle;
    }

    .fof h1{
        font-size: 50px;
        display: inline-block;
        padding-right: 12px;
        animation: type .5s alternate infinite;
    }

    @keyframes type{
        from{box-shadow: inset -3px 0px 0px #888;}
        to{box-shadow: inset -3px 0px 0px transparent;}
    }
    </style>
</head>
<body>
    <div class="container">
      <div id="main">
    	<div class="fof">
        		<h1>Error 404</h1>
                <h1> Real Programmer</h1>
    	</div>
</div>
    </div>
</body>
</html>

Now, run the server

php artisan serve

Check 404 page

http://127.0.0.1:8000/test

Write A Comment