When you try to save data to the database, the page just loads endlessly. I also tried other methods of saving, but it didn't help.зрзl
`class ContactController extends Controller{
public function submit(ContactRequest $req){
// $contactM = new Contact();
// $contact = $req->only(['name', 'email', 'subject', 'message']);
// $contactM->saved($contact);
$contact = new Contact();
$contact->name = $req->input('name');
$contact->email = $req->input('email');
$contact->subject = $req->input('subject');
$contact->message = $req->input('message');
$contact->save();
// Contact::create([
// 'name' => $req->get('name'),
// 'email' => $req->get('email'),
// 'subject' => $req->get('subject'), // еще один способ добавления данных в таблицу
// 'message' => $req->get('message'),
// ]);
return redirect()->route('home');
}
}`
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community