PHP code example of colq2 / blade-mjml

1. Go to this page and download the library: Download colq2/blade-mjml 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/ */

    

colq2 / blade-mjml example snippets


public function content(): Content
{
    return new Content(
        view: 'mail.mjml-example',
    );
}

public function content(): Content
{
    return new Content(
        view: 'mail.mjml-example',
    );
}

Route::get('/mjml-example', function () {
    return view('mail.mjml-example');
});
bladehtml
<!-- resources/views/mail/mjml-example.blade.php -->
<mjml>
    <mj-body>
        <mj-section>
            <mj-column>
                <mj-image width="100px" src="https://mjml.io/assets/img/logo-small.png"></mj-image>
                <mj-divider border-color="#F45E43"></mj-divider>
                <mj-text font-size="20px" color="#F45E43" font-family="helvetica">Hello World</mj-text>
            </mj-column>
        </mj-section>
    </mj-body>
</mjml>
bladehtml
// resources/views/mail/mjml-example.blade.php
<mjml>
    <mj-body>
        <mj-section>
            <mj-column>
                <mj-image width="100px" src="https://mjml.io/assets/img/logo-small.png"></mj-image>
                <mj-divider border-color="#F45E43"></mj-divider>
                <mj-text font-size="20px" color="#F45E43" font-family="helvetica">Hello World</mj-text>
            </mj-column>
        </mj-section>
    </mj-body>
</mjml>