Skip to content

Instantly share code, notes, and snippets.

@jasonherndon
Created July 21, 2015 15:12
Show Gist options
  • Save jasonherndon/5ed856ad26c370ad402e to your computer and use it in GitHub Desktop.
Save jasonherndon/5ed856ad26c370ad402e to your computer and use it in GitHub Desktop.
<?php namespace Laracove\Http\Controllers;
use Laracove\Services\Utility\SendMail;
use Laracove\Http\Controllers\Controller;
use Exception;
class AnyController extends Controller {
/**
* Form request from /edit
*
* @return response
*/
public function doSomething(SendMail $sendMail)
{
try {
// Send the update to the author
$sendMail->sendMail([
'subject' => '',
'template' => 'emails.submission_rejected',
'recipient_name' => '',
'recipient_email' => '',
]);
} catch (Exception $e) {
// do something else, return them
return redirect()->back();
}
// do something
return redirect()->back();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment