I'm new to laravel and I'm want to check if the value exist and it is equal to 1. Below is what I have tried. But it doesn't work.
if(isset($request['active_year'] == "1")) {
$activeYear = 1;
$currentActiveYear = AcademicYear::where('active_year', 1)->update(['active_year' => 0]);
} else {
$activeYear = 0;
}