Skip to content
Advertisement

How does Laravel Artisan created php files with properly formatted lines

This is just a general question, how does Laravel Artisan able to create proper .php file e.g. make:controller with the correct formatting and line breaks?

Is there a good PHP script which can help one develop similar php codes.

Thanks

Advertisement

Answer

PHP files are just text files, you can easily create them with any language. Also in Laravel usually used so called stubs, templates for classes like migrations, controllers etc.

Just go and look how as Laravel does that under the hood.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement