When you build a website, your computer code needs a way to draw nice web pages with text, buttons, and pictures. In Laravel, this visual part is called a Blade View. Think of Blade like a smart printing press that combines raw data with your HTML design.
Where Do Views Live?
In every Laravel project, all your visual templates live inside the resources/views folder. They always end with the .blade.php file extension.
// Inside routes/web.php
Route::get('/welcome', function () {
// Tell Laravel to show resources/views/greeting.blade.php
return view('greeting', ['name' => 'Bagus']);
});Displaying Data on Screen
Inside your Blade file, you print variables easily using double curly braces: {{ $name }}. Blade automatically cleans the text to keep your website safe from hackers.
<!-- Inside resources/views/greeting.blade.php -->
<h1>Hello, {{ $name }}!</h1>
<p>Welcome to your very first Laravel web page.</p>3 Things to Remember
- Location: Views always stay in
resources/views. - Extension: Always use
.blade.phpfor your templates. - Printing: Use
{{ $variable }}to show text safely.