The Blade Parser package can be installed with Composer using the following command:
1composer require stillat/blade-parser
If you'd like to change, or simply view all of the possible configuration options, you may publish the configuration file. To do this, run the following command from the root of your project:
1php artisan vendor:publish --tag=blade
The Blade parser is an extensive library with numerous APIs and utilities to explore. Depending on your integration goals or use case, you may narrow your reading to a specific area.
If you intend to:
Validate or Perform Linting on a Single Document: Reference the Document API documentation to learn about the validation methods available. In addition, you can learn more about adding custom validator rules by reading the Validator documentation.
Validate or Perform Linting on an Entire Project: Reference the Workspaces API documentation to learn more about performing actions on multiple documents simultaneously. Alternatively, you may be interested in exploring the documentation on the provided command-line utilities to help accomplish this goal.
Parse and Manipulate Blade Documents: You may consult the Document API documentation to learn how to parse and manipulate Blade documents.
Compile Individual Documents: To compile an individual Blade template, the easiest integration path is to reference the Document API and precisely read the documentation around the available compilation methods.
Compile Multiple Documents: To compile multiple Blade templates at once, reference the Workspaces API documentation to learn more about the available compilation options.
If you want to learn more about how things work under the hood, numerous pages within the documentation will help explain things. However, the best approach would be to view the source code on GitHub.