Skip to content

Instantly share code, notes, and snippets.

@sirawitpra
Created July 1, 2017 12:42
Show Gist options
  • Select an option

  • Save sirawitpra/cf3a76055a6d10295be3ae95a0dec447 to your computer and use it in GitHub Desktop.

Select an option

Save sirawitpra/cf3a76055a6d10295be3ae95a0dec447 to your computer and use it in GitHub Desktop.
<?php
namespace App\Listeners;
use App\Events\StockIsLow;
use App\Mail\LowStock;
use Illuminate\Support\Facades\Mail;
class SendStockIsLowEmail
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param OrderCreated $event
* @return void
*/
public function handle(OrderCreated $event)
{
Mail::to(config('app.admin_email'))->send(new LowStock($product));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment