(Update) Refator Toastr Notifications

This commit is contained in:
HDVinnie
2018-11-12 11:14:41 -05:00
parent 587eb9f03e
commit 87563a2473
46 changed files with 954 additions and 359 deletions
+17 -2
View File
@@ -16,10 +16,25 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use App\User;
use App\Mail\Contact;
use \Toastr;
use Brian2694\Toastr\Toastr;
class ContactController extends Controller
{
/**
* @var Toastr
*/
private $toastr;
/**
* ContactController Constructor
*
* @param Toastr $toastr
*/
public function __construct(Toastr $toastr)
{
$this->toastr = $toastr;
}
/**
* Contact Form
*
@@ -44,6 +59,6 @@ class ContactController extends Controller
$input = $request->all();
Mail::to($user->email, $user->username)->send(new Contact($input));
return redirect()->route('home')
->with(Toastr::success('Your Message Was Successfully Sent', 'Yay!', ['options']));
->with($this->toastr->success('Your Message Was Successfully Sent', 'Yay!', ['options']));
}
}