- How do I install surgiie/blade-cli with Composer?
- Install it as a dev dependency with composer require --dev surgiie/blade-cli. There is no service provider, database, or queue setup, so installation is just the Composer package plus a working PHP binary. Pin the exact version you test with, since the package is archived and future constraint resolution is not guaranteed.
- Does surgiie/blade-cli support Laravel 11 and Laravel 12?
- There is no official compatibility statement for Laravel 11 or 12. The package wraps illuminate/view and was last released in November 2023, so its illuminate/* constraint may not resolve against Laravel 11 or 12 applications. Verify resolution in a CI matrix against your actual PHP and Laravel versions before committing, and expect to be the one validating it.
- How do I pass data to a Blade template from the command line?
- You supply the data as options when invoking the command, and it is passed into the compiled view the same way the Blade compiler expects. Check the README for the exact flag or argument format, since it is effectively the only documentation available. For deeply nested data, a small internal wrapper that builds the payload is usually easier to maintain than long CLI arguments.
- Can I render a Blade template to stdout instead of writing a file?
- Yes, the package can write to stdout as well as to a file, so you can pipe output into other tools or redirect it inside a script. That is useful for quick previews and CI steps. If you only ever need file-to-file rendering, a short in-house command around BladeCompiler is a reasonable alternative.
- Why does a template render differently with blade-cli than inside my Laravel app?
- The CLI runs a standalone Blade environment, so it does not load your application's custom directives, class components, view namespaces, or configuration. Templates that depend on those can render incorrectly or silently differently through the CLI. If the same templates also render in-app, add a diff-based drift test before relying on the CLI output.
- Is surgiie/blade-cli still maintained, and is it safe for production use?
- The repository is archived, it has a single maintainer, and the last release was in November 2023. Expect composer audit to report it as an abandoned package, which requires an explicit accepted-risk exception. Treat it as vendored code you own, keep it off any request path, and name a person responsible for a fork if needed.
- Can I use surgiie/blade-cli to generate static HTML or documentation?
- Yes, generating static HTML, docs, config files, and email previews is the sensible use case, and it works well as a CI-time or batch artifact step. Keep it in dev dependencies and behind a Makefile target or CI step. Avoid using it anywhere on a live request path.
- Do custom Blade directives and components work with blade-cli?
- Not automatically. The CLI compiles templates in isolation, so your application's custom directives, class-based components, and view namespaces are not registered unless the package exposes a way to register them. Any directive-dependent template is a candidate for output divergence, so verify each one against in-app rendering.
- Can I use surgiie/blade-cli in a plain PHP project without Laravel?
- Yes, it is a thin CLI adapter over illuminate/view, so it can work in non-Laravel PHP projects where pulling in the Blade compiler beats standing up a full framework for static or config generation. The trade-off is the same abandoned-package risk. It is a poor fit if your build pipeline is Node or Go based, where invoking artisan inside a Laravel app is simpler.
- Should I use surgiie/blade-cli or write my own Blade compile command?
- The package's real logic is small: instantiate BladeCompiler, handle input and output paths, and write the result, which is well under a developer-day of work. Writing your own Artisan command removes the abandoned-dependency risk and gives you control over directives and components. If you do adopt the package, wrap it behind an internal command so replacing it later needs no consumer changes.