PHP code example of fatihirday / mail-template

1. Go to this page and download the library: Download fatihirday/mail-template 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/ */

    

fatihirday / mail-template example snippets


 php artisan vendor:publish --provider="Fatihirday\MailTemplate\MailTemplateServiceProvider"

 php artisan migrate
[PHP]
 

class ExampleMail extends Mailable
{
    use Queueable;
    use SerializesModels;
    use MailViewTemplate;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct(
        protected readonly string $languageCode = 'en',
        protected readonly array $data = []
    )
    {
        //
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->builder('default',  $this->languageCode);
        // Or custom subject
        // return $this->builder('default',  $this->languageCode, 'custom subject');
        
    }
}

php artisan mail:cache:clear