Level 50
is that in your contoller (or routes file callback) or somewhere else? what does it return then?
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
curl code executed successfully, but redirect not working, plz how redirect after execute
$ch = curl_init ();
curl_setopt ( $ch, CURLOPT_URL, $url );
curl_setopt ( $ch, CURLOPT_POST, true );
curl_setopt ( $ch, CURLOPT_HTTPHEADER, $headers );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $fields );
$exec = curl_exec($ch);
$result = json_decode($exec);
if($result->success == 1){
$status='success';
$msg='notifi sent';
}else{
$status = 'error';
$msg = $status;
}
curl_close($ch);
return redirect('/admin/notification')->with($status, $msg);
is that in your contoller (or routes file callback) or somewhere else? what does it return then?
Please or to participate in this conversation.