When you start a new Laravel project, you're greeted with a sleek but generic welcome page. While it's nice for initial testing, you'll eventually want to replace it with something more personalized—especially if you're building a real application.
In this post, I’ll walk you through how to customize Laravel’s default landing page to make it feel like it truly belongs to your project.
We shall replace the landing page with this simple page:
π Where is the Landing Page?
Laravel’s welcome page lives in this file:
resources/views/welcome.blade.php
This is a simple Blade file (Laravel’s templating engine), and you can customize it like any regular HTML page with embedded Blade syntax.
π§π¨ Let’s Customize It
Open welcome.blade.php in your text editor and replace its content with something more tailored to your app. For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome - Company Web Admin</title>
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@600&display=swap" rel="stylesheet">
<style>
table {
margin-top: 20px;
margin-left: auto;
margin-right: auto;
}
.custom-button {
background-color: #1d4ed8; /* Blue */
color: white;
padding: 10px 25px;
border: none;
border-radius: 8px; /* Rounded corners */
font-size: 16px;
font-weight: bold;
cursor: pointer;
}
.custom-button:hover {
background-color: #2563eb; /* Lighter blue on hover */
}
h1 {
text-align: center;
margin-top: 50px;
font-family: Arial, sans-serif;
}
</style>
</style>
</style>
</head>
<body>
<h1>Welcome to the Company Web Admin Page</h1>
<table>
<tr>
<td>
<a href="{{ route('login') }}">
<button>Login</button>
</a>
</td>
<td>
<a href="{{ route('register') }}">
<button>Register</button>
</a>
</td>
</tr>
</table>
</body>
</html>
|
With just a few lines of code, you now have a custom landing page that reflects your brand and leads users directly to the login form.
π§ͺ Test the Page
If you’re already running Laravel’s development server, simply refresh your browser at:
http://127.0.0.1:8000
You should see your new design immediately.
If not running yet, start it with:
php artisan serve
π Summary
-
Laravel’s landing page is just a Blade view (
welcome.blade.php). -
You can edit it like any HTML file.
-
Add your own styles, messages, and buttons to reflect your app’s purpose.
-
Use Blade’s
{{ route('login') }}to link directly to Laravel's built-in login page.
Customizing your Laravel landing page is a great first step in branding your application and guiding users toward what they need to do next.
Happy coding! π
Informative post on Customising the Laravel Landing Page! A personalized layout enhances branding and improves user engagement. To implement advanced design elements and smooth functionality, you can Hire Laravel Developers who specialize in building tailored landing pages that drive conversions and elevate digital presence.
ReplyDelete