How to update array value in Laravel
PHP Snippet 1:
public function affiliatedFacilities(){
return $this->belongsToMany("App\AffiliatedFacility");
}
PHP Snippet 2:
$userBasicInfo->affiliatedFacilities()->sync($request->get('affiliated_facility', []));
PHP Snippet 3:
list($one, $two, $three) = $array
PHP Snippet 4:
$one = 3, $two = 2, $three = 1
PHP Snippet 5:
list($one, $two, $three) = $array
// $one = 1, $two = 2, $three = 4