- How do I install Laravel Carve?
- Install it with Composer using composer require markup-carve/laravel-carve. The package is designed as a Laravel-native integration, so follow the README for service provider registration if your Laravel version does not auto-discover it. After installation, publish the configuration file if you want to customize parser options.
- Which Laravel versions are supported?
- The package overview does not list specific Laravel version constraints, so check the composer.json and README for the supported Laravel and PHP versions before installing. Because it integrates via a service provider and facade, it is intended for standard Laravel applications. Verify compatibility in your app's Composer constraints, especially on older or pre-release Laravel versions.
- How do I render Carve markup in a Blade template?
- Use the package's Blade-friendly rendering API or facade from your controller or view data, then output the generated HTML in your Blade template. Keep the conversion in PHP or a component rather than embedding parser logic directly in the template. The exact helper or facade method should be taken from the package README.
- Can I use Laravel Carve for user-authored content?
- Yes, it is intended for content rendering such as CMS pages, docs, and user-authored content. As with any markup-to-HTML pipeline, treat user input carefully and apply your application's normal sanitization and authorization rules. Use configurable parser options and output handling to control what HTML is produced.
- How do I publish and customize the Laravel Carve configuration?
- Publish the package configuration using Laravel's vendor publish command, typically php artisan vendor:publish, and select the Laravel Carve provider or config tag from the README. The published file lets you adjust parser options that control Carve output. Keep environment-specific settings out of version control where appropriate.
- What parser options can I configure in Laravel Carve?
- The package exposes configurable parser options for output control, but the exact option names depend on the Carve engine and the published config file. Review the published configuration and the Carve documentation for available flags and rendering behavior. Avoid assuming options beyond what the package README documents.
- How do I convert Carve markup to HTML in PHP code?
- Resolve the Laravel Carve facade or service from the container and call its rendering method with your Carve markup string. The package provides a simple API for converting Carve to HTML, so you can use it in controllers, jobs, or custom classes. Check the README for the exact method signature and return type.
- Is Laravel Carve suitable for production?
- It can be suitable for production when used with normal Laravel practices: pin the package version, review its parser configuration, and sanitize any untrusted markup output. Because the overview does not include a security audit or maintenance details, evaluate the repository's release history and issue activity before relying on it for critical content. Test rendering in staging with representative content.
- How do I test Carve rendering in a Laravel app?
- Write feature or unit tests that pass representative Carve markup through the package API and assert the resulting HTML. Use Laravel's testing helpers to bind or fake the facade if your code depends on the container. Keep fixture markup for edge cases such as nested structures and parser option variations.
- How is Laravel Carve different from using a Markdown package?
- Laravel Carve renders the Carve markup language rather than Markdown, so syntax and parser behavior differ. Choose it when you want Carve's expressive, readable markup with Laravel-native service provider, facade, and configuration integration. If your content is already Markdown or your team expects Markdown tooling, a Markdown package may be a better fit.