4 months ago

419 Sorry, your session has expired. Please refresh and try again.

Posted 4 months ago by Msoft

I am going to submit contact form data via the email as the following Controller,

public function contactUs()
       return view('contactUs');

    * Show the application dashboard.
    * @return \Illuminate\Http\Response
   public function contactUsPost(Request $request)
       $this->validate($request, [
        'name' => 'required',
        'email' => 'required|email',
        'message' => 'required'

           'name' => $request->get('name'),
           'email' => $request->get('email'),
           'user_message' => $request->get('message')
        ), function($message)
       $message->from('[email protected]');
       $message->to('[email protected]', 'Admin')
       ->subject('Contact Form Query');
   return back()->with('success', 'Thanks for contacting us!');

and route is,

Route::get('contact-us', '[email protected]');
'uses'=>'[email protected]'

and contact form

<form action="{{route('')}}" method="post">
<div class="form-group row">
    <label for="inputEmail3" class="col-sm-2 col-form-label">Name</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="inputEmail3" name="name" placeholder="Name">
  <div class="form-group row">
    <label for="inputEmail3" class="col-sm-2 col-form-label">Email</label>
    <div class="col-sm-10">
      <input type="email" class="form-control" id="inputEmail3" name="email" placeholder="Email">
   <div class="form-group">
  <label for="comment">Comment:</label>
  <textarea class="form-control" rows="5" name="message" id="comment"></textarea>
  <div class="form-group row">
    <div class="col-sm-10">
      <button type="submit" class="btn btn-primary">Sign in</button>

but when I click submit buttons I got following error massage ` 404

Sorry, the page you are looking for could not be found. ` how can fix this problem?

Please sign in or create an account to participate in this conversation.