There is the feature of Stubs Customization in Laravel in which you are free to modify the stubs files that are generated when you run php artisan vendor:publish. While in this tutorial we are going to create our own starter template that is defined on our own custom stub files from scratch.
The gist of this console command magic is to get the content of the stub file intereface.stuband change the stub variable of the file i.e. $NAMESPACE$ and $CLASS_NAME$ with the user-defined value and place it in the desired path in your project.
Add the getStubVariables function that will map the stub variable present in the stub file (interface.stub) mentioned above to its value In the return array above, the key NAMESPACE and CLASS_NAME are the stub variable (placeholder) present in the stub file with their respective value to replace the placeholder.