Using if-else less often in code. Is there any cleaner way?
These type of branching comes often.
if(isset($activePause)){
if(Carbon::parse($activePause->resume_date)->gt(Carbon::today())){
return back();
} else {
return view('customer_packages.pause_create');
} else {
return view('customer_packages.pause_create');
}
Aucun commentaire:
Enregistrer un commentaire