Method [validate] does not exist.

Posted 1 year ago by muazzamazaz
namespace App\Http\Controllers;
use App\ContactUS;
use Illuminate\Http\Request;
use App\Http\Requests;
use validator;
use Illuminate\Routing\Controller as BaseController;
class ContactUSController extends BaseController
{
public function contactUS(){
return view('CityOfWorks.ContactUS');
}
public function contactUSPost(Request $request){

$this->validate($request, ['name' => 'required','email' => 'required|email','message' => 'required']);

ContactUS::create($request->all());

return back()->with('success', 'Thanks for contacting us!');
}
}

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

Reply to

Use Markdown with GitHub-flavored code blocks.