Controller:
return redirect()->back()->with('success', 'your message,here');
Blade:
@if (Session::has('success'))
<div class="alert alert-success">
<ul>
<li>{!! Session::get('success') !!}</li>
</ul>
</div>
@endif
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->apiUrl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: text/plain'
));
$response = curl_exec($ch);
curl_close($ch);