ItSolutionStuff.com

Laravel 11 Create Blade File using Command Example

By Hardik Savani • September 4, 2024
Laravel

In this short post, i will show you how to create view blade file using artisan command in laravel 11 application. we will use make:view artisan command to create blade file.

Laravel has recently launched version 11, which includes a notable enhancement: the addition of a new Artisan command option for creating Blade files. You can now generate a view file in Laravel 11 by executing the following straightforward command: php artisan make:view welcome. This command simplifies the process of creating Blade files via the Artisan command.

laravel 11 cmd create vew

So, let's see the simple example below:

Example 1: Laravel 11 Create Blade File Command

Here, the below command will help you to create 'dashboard.blade.php' file. so, let's run it and check the output as well.

php artisan make:view dashboard

You can see the following output:

they will create new file as like the below:

resources/views/dashboard.blade.php

<div>
    <!-- Live as if you were to die tomorrow. Learn as if you were to live forever. - Mahatma Gandhi -->
</div>

Example 2: Laravel 11 Create Blade File inside Directory Command

Here, the below command will help you to create 'index.blade.php' file in users folder. so, let's run it and check the output as well.

php artisan make:view users.index

You can see the following output:

they will create new file as like the below:

resources/views/users/index.blade.php

<div>
    <!-- He who is contented is rich. - Laozi -->
</div>

These commands really help us.

I hope it can help you...

Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Install Bootstrap 5 in Laravel 11 with Vite?

Read Now →

Laravel 11 Image Validation Rules Example

Read Now →

Laravel 11 Send SMS using Twilio Tutorial Example

Read Now →

Laravel 11 Store Backup on Dropbox using Spatie Tutorial

Read Now →

Laravel 11 Custom User Login and Registration Tutorial

Read Now →

Laravel 11 Install Tailwind CSS Step by Step

Read Now →

Laravel 11 User Roles and Permissions Tutorial

Read Now →

Laravel 11 Livewire Wizard Multi Step Form Tutorial

Read Now →

Laravel 11 CKeditor Image Upload Example

Read Now →

Laravel 11 Restrict User Access from IP Address Example

Read Now →

How to Create ZIP Archive File in Laravel 11?

Read Now →

How to Save JSON Data in Database in Laravel 11?

Read Now →

Laravel 11 Multiple File Upload Example

Read Now →