FleetCart/Modules/Contact/Http/Controllers/ContactController.php
2023-12-03 14:07:47 +00:00

42 lines
1009 B
PHP

<?php
namespace Modules\Contact\Http\Controllers;
use Illuminate\Mail\Message;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Mail;
use Modules\Contact\Http\Requests\ContactRequest;
class ContactController
{
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return view('public.contact.create');
}
/**
* Store a newly created resource in storage.
*
* @param Request $request
*
* @return Response
*/
public function store(ContactRequest $request)
{
Mail::raw($request->message, function (Message $message) use ($request) {
$message->subject($request->subject)
->replyTo($request->email)
->to(setting('store_email'));
});
return back()->with('success', trans('contact::messages.your_message_has_been_sent'));
}
}