1. Go to this page and download the library: Download tomirons/tuxedo 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/ */
tomirons / tuxedo example snippets
TomIrons\Tuxedo\TuxedoServiceProvider::class
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use TomIrons\Tuxedo\Mailables\ActionMailable;
class ActionMail extends ActionMailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->greeting('Hello!')
->line('Some line of text to tell you what exactly is going on.')
->action('Click here to do something fun', url('/'))
->line('Some other information to be displayed after the button.')
->salutation('Regards, Example App');
}
}
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use TomIrons\Tuxedo\Mailables\AlertMailable;
class AlertMail extends AlertMailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->greeting('Hello!')
->info()
->message('Some text goes here to inform the user')
->line('Some line of text to tell you what exactly is going on.')
->salutation('Regards, Example App');
}
}
namespace App\Mail;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use TomIrons\Tuxedo\Mailables\InvoiceMailable;
class InvoiceMail extends InvoiceMailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->id(123456)
->greeting('Hi John Doe!')
->date(Carbon::now()->format('l, M j Y \a\t g:i a'))
->due(Carbon::now()->addDays(7)->format('l, M j Y \a\t g:i a'))
->action('Click me to pay', url('/'))
->items([
['product_name' => 'Example Product', 'product_price' => 123.99],
['product_name' => 'Second Product', 'product_price' => 321.99]
])
->calculate(3, 15)
->salutation('Regards, Example App');
}
}