Level 17
in your controller please:
return redirect('/your-route')
->with('message', 'Payment successfull');
in blade
@if(session('message'))
{{ session('message')}}
@endif
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, I am working on some payment API and using some controller to handle the request sent through that Api. Now I want to redirect to another page immediately that request has been successful but then it is not working on that route.
//My controller:
$curl_response = curl_exec($curl);
if($curl_response){
$this->confirmForm();
}```
//confirmForm Method:
public function confirmForm(){
$page_title = "Lipa na M-PESA confirmation";
return view(activeTemplate() . 'payment.mpesa-confirm', compact('page_title'));
}
The curl_response is running successfully but it is not redirecting. How do I solve this?
Please or to participate in this conversation.