{"id":24764119,"url":"https://github.com/stillat/blade-parser","last_synced_at":"2025-04-05T19:10:52.626Z","repository":{"id":63431337,"uuid":"343541352","full_name":"Stillat/blade-parser","owner":"Stillat","description":"A library that makes it simple to parse, analyze, and manipulate Blade templates. Designed with tool makers in mind ❤️","archived":false,"fork":false,"pushed_at":"2024-04-16T23:16:01.000Z","size":450,"stargazers_count":109,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-01T13:26:14.104Z","etag":null,"topics":["laravel","parser","php"],"latest_commit_sha":null,"homepage":"https://bladeparser.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Stillat.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"johnathonkoster"}},"created_at":"2021-03-01T20:02:39.000Z","updated_at":"2024-04-30T07:00:40.000Z","dependencies_parsed_at":"2024-02-22T00:35:22.214Z","dependency_job_id":"4b932f42-41c7-4642-9e72-01355df3aa3c","html_url":"https://github.com/Stillat/blade-parser","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.1875,"last_synced_commit":"2534d0f30ed0ba47af8b3f47e6650294f3c477e2"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stillat%2Fblade-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stillat%2Fblade-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stillat%2Fblade-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stillat%2Fblade-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stillat","download_url":"https://codeload.github.com/Stillat/blade-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386262,"owners_count":20930619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","parser","php"],"created_at":"2025-01-28T21:32:56.879Z","updated_at":"2025-04-05T19:10:52.588Z","avatar_url":"https://github.com/Stillat.png","language":"PHP","readme":"![](.art/banner.png)\n\nBlade Parser is library for Laravel that makes it easy to parse, analyze, and manipulate Blade templates.\n\nThe library is composed of many major components:\n\n* **Parser**: A Blade parser that produces a list of nodes, which can be analyzed to help make decisions surrounding a template.\n* **Documents**: A powerful abstraction that makes it much simpler to interact with the details of a single parsed Blade template.\n* **Workspaces**: A simple set of APIs that make it effortless to work with multiple parsed Blade templates at once.\n* **Compiler**: A highly configurable Blade compiler implementation, with support for precompilers, extensions, and existing third-party packages.\n* **Validator**: An extensible system for validating Blade documents, with default validators capable of detecting unpaired conditions, invalid component parameter spacing, and much more.\n\n## Simple to Use\n\nParsing Blade templates is incredibly simple using the Documents API. As an example, this is all that is needed to parse a template:\n\n```php\n\u003c?php\n \nuse Stillat\\BladeParser\\Document\\Document;\n \n$template = \u003c\u003c\u003c'BLADE'\n    Hello, {{ $world }}\nBLADE;\n \n$document = Document::fromText($template);\n```\n\nThe `Document` class provides a powerful abstraction, making it simple to quickly retrieve information about a template.\n\nFor instance, if we wanted to extract all the components from our template we could do this:\n\n```php\n\u003c?php\n\n// Do something with all component tags in the template.\n$document-\u003egetComponents()\n          -\u003eeach(fn($node) =\u003e ...);\n```\n\nIf we were only interested in a component named `alert`, we could instead use:\n\n```php\n\u003c?php\n\n// Find all \"alert\" components.\n$document-\u003efindComponentsByTagName('alert')\n         -\u003eeach(fn($node) =\u003e ...);\n```\n\nThese examples hardly scratch the surface, and you are encouraged to read through the [Documentation](https://bladeparser.com/).\n\n## Built-in Validation Command\n\nThis library also ships with a configurable `blade:validate` Artisan command which can be used to validate all Blade templates within a project.\n\nTo configure the command, you will need to publish its configuration files using the following command:\n\n```bash\nphp artisan vendor:publish --tag=blade\n```\n\nTo run the validation against your project, you can issue the following Artisan command:\n\n```bash\nphp artisan blade:validate\n```\n\nIf any validation issues were detected they will be displayed in your terminal.\n\nThere are many configuration options available, and if you'd like to learn more you can find them documented in the [Configuring the Validate Command](https://bladeparser.com/docs/v1/the-validate-command#configuring-the-validate-command) article.\n\n## License\n\nThis parser library is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","funding_links":["https://github.com/sponsors/johnathonkoster"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstillat%2Fblade-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstillat%2Fblade-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstillat%2Fblade-parser/lists"}