Good day to all, I was creating CRUD operation for my project and wanted to ensure that after user creates new record he or she would redirect to a certain page and with success message thus I decided to use withSuccess()
but even if new record is added success message is not shown. The code I use:
Route::post('/contact/submit', function (Request $request) {
$contact=new Contact();
$contact->FirstName=$request->input('FirstName');
$contact->LastName=$request->input('LastName');
$contact->Age=$request->input('Age');
$contact->save();
return redirect('/contact')->withSuccess('Created');
});