Laravel Blade On Demand

screenshot of Laravel Blade On Demand
laravel

Compile Blade templates in memory

Overview:

The Laravel Blade On Demand package is a Laravel package that allows for the compilation of Blade templates in memory. It is compatible with Laravel 9 and requires PHP version 8.0 or higher. The package offers features such as rendering Blade templates, handling missing variables, rendering Markdown mail to HTML or text, and parsing Maildown mail. Additionally, it provides the ability to easily sponsor the maintenance and development of the package.

Features:

  • Render Blade template: Render any valid Blade template by calling the render method on the BladeOnDemand facade, passing the template content and the data to be passed to the template.
  • Handle missing variables: Prevent rendering failures when a variable is missing by filling it with the name of the variable itself. It also allows for custom handling of missing variables.
  • Render Markdown Mail to HTML: Render a mail as if using a Markdown mailable. Optional theme specification is available.
  • Render Markdown Mail to text: Similar to the above feature, but uses components from the text directory. Can be used for rendering Markdown mail to text format.
  • Parse Maildown Mail: Parse Markdown mail using the parseMarkdownMail method, which also converts it to text format.

Summary:

The Laravel Blade On Demand package is a useful tool for compiling Blade templates in memory. It offers several features such as rendering Blade templates, handling missing variables, and rendering Markdown mail to HTML or text. The package is compatible with Laravel 9 and requires PHP 8.0 or higher. It provides a convenient way to create dynamic and interactive applications using Blade templates.

laravel
Laravel

Laravel is a powerful and elegant PHP framework that provides developers with a comprehensive set of tools and features to build robust web applications. It follows the Model-View-Controller (MVC) architectural pattern, offering a clean and organized structure for writing efficient and maintainable code.