//If it didn't help (still, keep routes.php without web middleware), you can try little bit different approach:
return redirect()->back()->with('message', 'IT WORKS!');
// Displaying message if it exists:
@if(session()->has('message'))
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
@endif
return redirect()->route('agent')->with(
'success', __('Agent successfully added!')
);
return redirect()->back()->with('error', __('Permission Denied.'));
...
$recipe->save();
$data = [
'success' => true,
'message'=> 'Your AJAX processed correctly'
] ;
return response()->json($data);