Blueprint comes with a set of
artisan commands which are helpful during code generation. All of these commands are under the
While we will cover each of the commands below, you may get additional help for any of these commands by using the
--help option. For example:
php artisan blueprint:build --help
blueprint:build command is the one you'll use most often as this handles Generating Components.
It accepts a single argument of path to your draft file. This argument is optional. By default, Blueprint will attempt to load a
draft.yml) file from the project root folder.
As such, it's convenient to use the
draft.yaml file for defining components, but reuse it instead of creating separate draft files each time you run the
blueprint:build will output a list of the files it created and updated.
Blueprint includes a
blueprint:new command. This command may be helpful when you want to start using Blueprint within your project.
blueprint:new command will generate a
draft.yaml file with stubs for the
controllers sections, as well as run the
trace command to preload your existing models into Blueprint's cache.
Blueprint also comes with a
blueprint:erase command. Anytime you run
blueprint:build, the list of generated components is cached in a local
blueprint:erase command can be used to undo the last
blueprint:build command. Upon running this command, any of the files generated during the last build will be deleted.
If you realize a mistake after running
blueprint:build and would like to rebuild your components, your may run
blueprint:erasecommand is offered for convenience, its capabilities are limited. Instead, Blueprint recommends running
blueprint:buildfrom a clean working state. This way, you can use version control commands to undo the changes with finer control.
When using Blueprint with existing applications, you may need to reference existing models when generating new components. Furthermore, even though Blueprint caches the generated model definitions in a
.blueprint file, this file may become outdated as you continue to develop your application.
At anytime, you may run the
blueprint:trace command to have Blueprint analyze your application and update its cache with all of your existing models.