1. Go to this page and download the library: Download spatie/mjml-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Spatie\Mjml\Mjml;
// let's assume $mjml contains the MJML you want to convert
$html = Mjml::new()->toHtml($mjml);
use Spatie\Mjml\Mjml;
// let's assume $mjml contains the MJML you want to convert
$result = Mjml::new()->convert($mjml); // returns an instance of Spatie\Mjml\MjmlResult
use Spatie\Mjml\Mjml;
// let's assume $mjml contains the MJML you want to convert
$minifiedHtml = Mjml::new()->minify()->toHtml($mjml);
use Spatie\Mjml\Mjml;
// let's assume $mjml contains the MJML you want to convert
$minifiedHtml = Mjml::new()->minify()->toHtml($mjml, [
'beautify' => true,
'minify' => true,
]);
use Spatie\Mjml\Mjml;
Mjml::new()->canConvert($mjml); // returns a boolean
use Spatie\Mjml\Mjml;
Mjml::new()->canConvertWithoutErrors($mjml); // returns a boolean
/*
* All of your function classes that you'd like to deploy go here.
*/
'functions' => [
\Spatie\MjmlSidecar\MjmlFunction::class,
],
bash
composer
shell
php artisan sidecar:deploy --activate
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.