Файл: app/Http/Controllers/ContactController.php
Строк: 48
<?php
namespace AppHttpControllers;
use AppHttpRequestsContactMailRequest;
use AppMailContactMail;
use IlluminateSupportFacadesMail;
class ContactController extends Controller
{
/**
* Show the Contact page.
*
* @return IlluminateContractsFoundationApplication|IlluminateContractsViewFactory|IlluminateViewView
*/
public function index()
{
return view('contact.index');
}
/**
* Send the Contact email.
*
* @param ContactMailRequest $request
* @return IlluminateHttpRedirectResponse
*/
public function send(ContactMailRequest $request)
{
try {
Mail::to(config('settings.contact_email'))->send(new ContactMail());
} catch(Exception $e) {
return redirect()->route('contact')->with('error', $e->getMessage());
}
return redirect()->route('contact')->with('success', __('Thank you!').' '.__('We've received your message.'));
}
}