In this video we are going to learn about Stub Customization.
The php artisan make commands are used to create a variety of classes,
such as controllers, models, migrations and job.
These classes are generated using \"stub\" files.
That are populated with values based on your input.
However, you may sometimes wish to make small changes to files generated by Artisan.
To accomplish this, Laravel 8 provides the stub:publish command.
So lets run this stub publish command.
Goto the command prompt and run the command.

php artisan stub:publish

now stub is published.
The published stubs will be located within a stubs directory.
So goto the project and here inside project root directory.
You can see the stub folder.
Just open this stubs folder and you can see all the stubs.
Like here is stubs for the controller, Job, Migration, Model and Test.
Ok Lets open any one stub.
So Lets open this controller.plain.stub file.
Inside this file you can see.
There are some default codes are written here.
Whenever we create any new controller.
These default codes are written in that controller.
Now I am going to create a new controller to show you.
So, switch to the command prompt.
and here just type the command.

php artisan make:controller StudentController


Now Let see the controller.
So goto the project.
Click on app folder then http.
Go Inside the controller folder.
And just open the StudentController.
And you can see inside the Student Controller.
These are the code which are coming from the controller.plain.stub file.
Alright now make some changes inside the stub file.
So go to the controller.plain.stub file.
and just open it and here.
I am just going to create a function.

public function create()
{
//
}

Alright, Now create another new controller and see the changes inside the controller.
So go to the command prompt and type.

php artisan make:controller StudentnewController

Ok controller created.
Now switch to the project.
and here just open StudentnewController.
You can see the differences.
Here is new default controller code is written here ok.
So in this way we can customize any of these stubs.